/*
 *
 *    Copyright (c) 2021 Project CHIP Authors
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

// THIS FILE IS GENERATED BY ZAP

#include <app/chip-zcl-zpro-codec.h>

#include <support/BufferWriter.h>
#include <support/SafeInt.h>
#include <support/logging/CHIPLogging.h>

#include <app/common/gen/ids/Attributes.h>
#include <app/common/gen/ids/Clusters.h>
#include <app/common/gen/ids/Commands.h>
#include <app/util/basic-types.h>
#include <lib/support/Span.h>

using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::System;
using namespace chip::Encoding::LittleEndian;

#define COMMAND_HEADER(name, clusterId)                                                                                            \
    const char * kName = name;                                                                                                     \
                                                                                                                                   \
    PacketBufferWriter buf(System::PacketBufferHandle::New(kMaxBufferSize));                                                       \
    if (buf.IsNull())                                                                                                              \
    {                                                                                                                              \
        ChipLogError(Zcl, "Could not allocate packet buffer while trying to encode %s command", kName);                            \
        return PacketBufferHandle();                                                                                               \
    }                                                                                                                              \
                                                                                                                                   \
    if (doEncodeApsFrame(buf, clusterId, kSourceEndpoint, destinationEndpoint, 0, 0, 0, 0, false))                                 \
    {

#define COMMAND_FOOTER()                                                                                                           \
    }                                                                                                                              \
    if (!buf.Fit())                                                                                                                \
    {                                                                                                                              \
        ChipLogError(Zcl, "Command %s can't fit in the allocated buffer", kName);                                                  \
    }                                                                                                                              \
    return buf.Finalize();

/*----------------------------------------------------------------------------*\
| Cluster Name                                                        |   ID   |
|---------------------------------------------------------------------+--------|
| AccountLogin                                                        | 0x050E |
| ApplicationBasic                                                    | 0x050D |
| ApplicationLauncher                                                 | 0x050C |
| AudioOutput                                                         | 0x050B |
| BarrierControl                                                      | 0x0103 |
| Basic                                                               | 0x0028 |
| BinaryInputBasic                                                    | 0x000F |
| Binding                                                             | 0xF000 |
| BridgedDeviceBasic                                                  | 0x0039 |
| ColorControl                                                        | 0x0300 |
| ContentLauncher                                                     | 0x050A |
| Descriptor                                                          | 0x001D |
| DiagnosticLogs                                                      | 0x0032 |
| DoorLock                                                            | 0x0101 |
| ElectricalMeasurement                                               | 0x0B04 |
| EthernetNetworkDiagnostics                                          | 0x0037 |
| FixedLabel                                                          | 0x0040 |
| FlowMeasurement                                                     | 0x0404 |
| GeneralCommissioning                                                | 0x0030 |
| GeneralDiagnostics                                                  | 0x0033 |
| GroupKeyManagement                                                  | 0xF004 |
| Groups                                                              | 0x0004 |
| Identify                                                            | 0x0003 |
| KeypadInput                                                         | 0x0509 |
| LevelControl                                                        | 0x0008 |
| LowPower                                                            | 0x0508 |
| MediaInput                                                          | 0x0507 |
| MediaPlayback                                                       | 0x0506 |
| NetworkCommissioning                                                | 0x0031 |
| OtaSoftwareUpdateProvider                                           | 0x0029 |
| OccupancySensing                                                    | 0x0406 |
| OnOff                                                               | 0x0006 |
| OperationalCredentials                                              | 0x003E |
| PressureMeasurement                                                 | 0x0403 |
| PumpConfigurationAndControl                                         | 0x0200 |
| RelativeHumidityMeasurement                                         | 0x0405 |
| Scenes                                                              | 0x0005 |
| SoftwareDiagnostics                                                 | 0x0034 |
| Switch                                                              | 0x003B |
| TvChannel                                                           | 0x0504 |
| TargetNavigator                                                     | 0x0505 |
| TemperatureMeasurement                                              | 0x0402 |
| TestCluster                                                         | 0x050F |
| Thermostat                                                          | 0x0201 |
| ThreadNetworkDiagnostics                                            | 0x0035 |
| WakeOnLan                                                           | 0x0503 |
| WiFiNetworkDiagnostics                                              | 0x0036 |
| WindowCovering                                                      | 0x0102 |
\*----------------------------------------------------------------------------*/

#define EMBER_ZCL_REPORTING_DIRECTION_REPORTED 0x00

// TODO: Find a way to calculate maximum message length for clusters
//       https://github.com/project-chip/connectedhomeip/issues/965
constexpr uint16_t kMaxBufferSize = 1024;

// This is a global command, so the low bits are 0b00.  The command is
// standard, so does not need a manufacturer code, and we're sending client
// to server, so all the remaining bits are 0.
constexpr uint8_t kFrameControlGlobalCommand = 0x00;

// Pick source endpoint as 1 for now
constexpr EndpointId kSourceEndpoint = 1;

/*----------------------------------------------------------------------------*\
| Cluster AccountLogin                                                | 0x050E |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * GetSetupPIN                                                       |   0x00 |
| * Login                                                             |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeAccountLoginClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverAccountLoginAttributes", AccountLogin::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeAccountLoginClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadAccountLoginClusterRevision", AccountLogin::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster ApplicationBasic                                            | 0x050D |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ChangeStatus                                                      |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * VendorName                                                        | 0x0000 |
| * VendorId                                                          | 0x0001 |
| * ApplicationName                                                   | 0x0002 |
| * ProductId                                                         | 0x0003 |
| * ApplicationId                                                     | 0x0005 |
| * CatalogVendorId                                                   | 0x0006 |
| * ApplicationStatus                                                 | 0x0007 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeApplicationBasicClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverApplicationBasicAttributes", ApplicationBasic::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute VendorName
 */
PacketBufferHandle encodeApplicationBasicClusterReadVendorNameAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationBasicVendorName", ApplicationBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationBasic::Attributes::Ids::VendorName);
    COMMAND_FOOTER();
}

/*
 * Attribute VendorId
 */
PacketBufferHandle encodeApplicationBasicClusterReadVendorIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationBasicVendorId", ApplicationBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationBasic::Attributes::Ids::VendorId);
    COMMAND_FOOTER();
}

/*
 * Attribute ApplicationName
 */
PacketBufferHandle encodeApplicationBasicClusterReadApplicationNameAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationBasicApplicationName", ApplicationBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationBasic::Attributes::Ids::ApplicationName);
    COMMAND_FOOTER();
}

/*
 * Attribute ProductId
 */
PacketBufferHandle encodeApplicationBasicClusterReadProductIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationBasicProductId", ApplicationBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationBasic::Attributes::Ids::ProductId);
    COMMAND_FOOTER();
}

/*
 * Attribute ApplicationId
 */
PacketBufferHandle encodeApplicationBasicClusterReadApplicationIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationBasicApplicationId", ApplicationBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationBasic::Attributes::Ids::ApplicationId);
    COMMAND_FOOTER();
}

/*
 * Attribute CatalogVendorId
 */
PacketBufferHandle encodeApplicationBasicClusterReadCatalogVendorIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationBasicCatalogVendorId", ApplicationBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationBasic::Attributes::Ids::CatalogVendorId);
    COMMAND_FOOTER();
}

/*
 * Attribute ApplicationStatus
 */
PacketBufferHandle encodeApplicationBasicClusterReadApplicationStatusAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationBasicApplicationStatus", ApplicationBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationBasic::Attributes::Ids::ApplicationStatus);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeApplicationBasicClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationBasicClusterRevision", ApplicationBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster ApplicationLauncher                                         | 0x050C |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * LaunchApp                                                         |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ApplicationLauncherList                                           | 0x0000 |
| * CatalogVendorId                                                   | 0x0001 |
| * ApplicationId                                                     | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeApplicationLauncherClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverApplicationLauncherAttributes", ApplicationLauncher::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute ApplicationLauncherList
 */
PacketBufferHandle encodeApplicationLauncherClusterReadApplicationLauncherListAttribute(uint8_t seqNum,
                                                                                        EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationLauncherApplicationLauncherList", ApplicationLauncher::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationLauncher::Attributes::Ids::ApplicationLauncherList);
    COMMAND_FOOTER();
}

/*
 * Attribute CatalogVendorId
 */
PacketBufferHandle encodeApplicationLauncherClusterReadCatalogVendorIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationLauncherCatalogVendorId", ApplicationLauncher::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationLauncher::Attributes::Ids::CatalogVendorId);
    COMMAND_FOOTER();
}

/*
 * Attribute ApplicationId
 */
PacketBufferHandle encodeApplicationLauncherClusterReadApplicationIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationLauncherApplicationId", ApplicationLauncher::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ApplicationLauncher::Attributes::Ids::ApplicationId);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeApplicationLauncherClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadApplicationLauncherClusterRevision", ApplicationLauncher::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster AudioOutput                                                 | 0x050B |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * RenameOutput                                                      |   0x01 |
| * SelectOutput                                                      |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * AudioOutputList                                                   | 0x0000 |
| * CurrentAudioOutput                                                | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeAudioOutputClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverAudioOutputAttributes", AudioOutput::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute AudioOutputList
 */
PacketBufferHandle encodeAudioOutputClusterReadAudioOutputListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadAudioOutputAudioOutputList", AudioOutput::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(AudioOutput::Attributes::Ids::AudioOutputList);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentAudioOutput
 */
PacketBufferHandle encodeAudioOutputClusterReadCurrentAudioOutputAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadAudioOutputCurrentAudioOutput", AudioOutput::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(AudioOutput::Attributes::Ids::CurrentAudioOutput);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeAudioOutputClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadAudioOutputClusterRevision", AudioOutput::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster BarrierControl                                              | 0x0103 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * BarrierControlGoToPercent                                         |   0x00 |
| * BarrierControlStop                                                |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * BarrierMovingState                                                | 0x0001 |
| * BarrierSafetyStatus                                               | 0x0002 |
| * BarrierCapabilities                                               | 0x0003 |
| * BarrierPosition                                                   | 0x000A |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeBarrierControlClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverBarrierControlAttributes", BarrierControl::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute BarrierMovingState
 */
PacketBufferHandle encodeBarrierControlClusterReadBarrierMovingStateAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBarrierControlBarrierMovingState", BarrierControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BarrierControl::Attributes::Ids::BarrierMovingState);
    COMMAND_FOOTER();
}

/*
 * Attribute BarrierSafetyStatus
 */
PacketBufferHandle encodeBarrierControlClusterReadBarrierSafetyStatusAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBarrierControlBarrierSafetyStatus", BarrierControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BarrierControl::Attributes::Ids::BarrierSafetyStatus);
    COMMAND_FOOTER();
}

/*
 * Attribute BarrierCapabilities
 */
PacketBufferHandle encodeBarrierControlClusterReadBarrierCapabilitiesAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBarrierControlBarrierCapabilities", BarrierControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BarrierControl::Attributes::Ids::BarrierCapabilities);
    COMMAND_FOOTER();
}

/*
 * Attribute BarrierPosition
 */
PacketBufferHandle encodeBarrierControlClusterReadBarrierPositionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBarrierControlBarrierPosition", BarrierControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BarrierControl::Attributes::Ids::BarrierPosition);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeBarrierControlClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBarrierControlClusterRevision", BarrierControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster Basic                                                       | 0x0028 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * MfgSpecificPing                                                   |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * InteractionModelVersion                                           | 0x0000 |
| * VendorName                                                        | 0x0001 |
| * VendorID                                                          | 0x0002 |
| * ProductName                                                       | 0x0003 |
| * ProductID                                                         | 0x0004 |
| * UserLabel                                                         | 0x0005 |
| * Location                                                          | 0x0006 |
| * HardwareVersion                                                   | 0x0007 |
| * HardwareVersionString                                             | 0x0008 |
| * SoftwareVersion                                                   | 0x0009 |
| * SoftwareVersionString                                             | 0x000A |
| * ManufacturingDate                                                 | 0x000B |
| * PartNumber                                                        | 0x000C |
| * ProductURL                                                        | 0x000D |
| * ProductLabel                                                      | 0x000E |
| * SerialNumber                                                      | 0x000F |
| * LocalConfigDisabled                                               | 0x0010 |
| * Reachable                                                         | 0x0011 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeBasicClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverBasicAttributes", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute InteractionModelVersion
 */
PacketBufferHandle encodeBasicClusterReadInteractionModelVersionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicInteractionModelVersion", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::InteractionModelVersion);
    COMMAND_FOOTER();
}

/*
 * Attribute VendorName
 */
PacketBufferHandle encodeBasicClusterReadVendorNameAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicVendorName", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::VendorName);
    COMMAND_FOOTER();
}

/*
 * Attribute VendorID
 */
PacketBufferHandle encodeBasicClusterReadVendorIDAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicVendorID", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::VendorID);
    COMMAND_FOOTER();
}

/*
 * Attribute ProductName
 */
PacketBufferHandle encodeBasicClusterReadProductNameAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicProductName", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::ProductName);
    COMMAND_FOOTER();
}

/*
 * Attribute ProductID
 */
PacketBufferHandle encodeBasicClusterReadProductIDAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicProductID", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::ProductID);
    COMMAND_FOOTER();
}

/*
 * Attribute UserLabel
 */
PacketBufferHandle encodeBasicClusterReadUserLabelAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicUserLabel", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::UserLabel);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeBasicClusterWriteUserLabelAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                             chip::ByteSpan userLabel)
{
    COMMAND_HEADER("WriteBasicUserLabel", Basic::Id);
    size_t userLabelStrLen = userLabel.size();
    if (!CanCastTo<uint8_t>(userLabelStrLen))
    {
        ChipLogError(Zcl, "Error encoding %s command. String too long: %zu", kName, userLabelStrLen);
        return PacketBufferHandle();
    }

    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(Basic::Attributes::Ids::UserLabel)
        .Put8(66)
        .Put(static_cast<uint8_t>(userLabelStrLen))
        .Put(userLabel.data(), userLabelStrLen);
    COMMAND_FOOTER();
}

/*
 * Attribute Location
 */
PacketBufferHandle encodeBasicClusterReadLocationAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicLocation", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::Location);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeBasicClusterWriteLocationAttribute(uint8_t seqNum, EndpointId destinationEndpoint, chip::ByteSpan location)
{
    COMMAND_HEADER("WriteBasicLocation", Basic::Id);
    size_t locationStrLen = location.size();
    if (!CanCastTo<uint8_t>(locationStrLen))
    {
        ChipLogError(Zcl, "Error encoding %s command. String too long: %zu", kName, locationStrLen);
        return PacketBufferHandle();
    }

    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(Basic::Attributes::Ids::Location)
        .Put8(66)
        .Put(static_cast<uint8_t>(locationStrLen))
        .Put(location.data(), locationStrLen);
    COMMAND_FOOTER();
}

/*
 * Attribute HardwareVersion
 */
PacketBufferHandle encodeBasicClusterReadHardwareVersionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicHardwareVersion", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::HardwareVersion);
    COMMAND_FOOTER();
}

/*
 * Attribute HardwareVersionString
 */
PacketBufferHandle encodeBasicClusterReadHardwareVersionStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicHardwareVersionString", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::HardwareVersionString);
    COMMAND_FOOTER();
}

/*
 * Attribute SoftwareVersion
 */
PacketBufferHandle encodeBasicClusterReadSoftwareVersionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicSoftwareVersion", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::SoftwareVersion);
    COMMAND_FOOTER();
}

/*
 * Attribute SoftwareVersionString
 */
PacketBufferHandle encodeBasicClusterReadSoftwareVersionStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicSoftwareVersionString", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::SoftwareVersionString);
    COMMAND_FOOTER();
}

/*
 * Attribute ManufacturingDate
 */
PacketBufferHandle encodeBasicClusterReadManufacturingDateAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicManufacturingDate", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::ManufacturingDate);
    COMMAND_FOOTER();
}

/*
 * Attribute PartNumber
 */
PacketBufferHandle encodeBasicClusterReadPartNumberAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicPartNumber", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::PartNumber);
    COMMAND_FOOTER();
}

/*
 * Attribute ProductURL
 */
PacketBufferHandle encodeBasicClusterReadProductURLAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicProductURL", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::ProductURL);
    COMMAND_FOOTER();
}

/*
 * Attribute ProductLabel
 */
PacketBufferHandle encodeBasicClusterReadProductLabelAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicProductLabel", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::ProductLabel);
    COMMAND_FOOTER();
}

/*
 * Attribute SerialNumber
 */
PacketBufferHandle encodeBasicClusterReadSerialNumberAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicSerialNumber", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::SerialNumber);
    COMMAND_FOOTER();
}

/*
 * Attribute LocalConfigDisabled
 */
PacketBufferHandle encodeBasicClusterReadLocalConfigDisabledAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicLocalConfigDisabled", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::LocalConfigDisabled);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeBasicClusterWriteLocalConfigDisabledAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                       uint8_t localConfigDisabled)
{
    COMMAND_HEADER("WriteBasicLocalConfigDisabled", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(Basic::Attributes::Ids::LocalConfigDisabled)
        .Put8(16)
        .Put8(static_cast<uint8_t>(localConfigDisabled));
    COMMAND_FOOTER();
}

/*
 * Attribute Reachable
 */
PacketBufferHandle encodeBasicClusterReadReachableAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicReachable", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Basic::Attributes::Ids::Reachable);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeBasicClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBasicClusterRevision", Basic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster BinaryInputBasic                                            | 0x000F |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * OutOfService                                                      | 0x0051 |
| * PresentValue                                                      | 0x0055 |
| * StatusFlags                                                       | 0x006F |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeBinaryInputBasicClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverBinaryInputBasicAttributes", BinaryInputBasic::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute OutOfService
 */
PacketBufferHandle encodeBinaryInputBasicClusterReadOutOfServiceAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBinaryInputBasicOutOfService", BinaryInputBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BinaryInputBasic::Attributes::Ids::OutOfService);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeBinaryInputBasicClusterWriteOutOfServiceAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                           uint8_t outOfService)
{
    COMMAND_HEADER("WriteBinaryInputBasicOutOfService", BinaryInputBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(BinaryInputBasic::Attributes::Ids::OutOfService)
        .Put8(16)
        .Put8(static_cast<uint8_t>(outOfService));
    COMMAND_FOOTER();
}

/*
 * Attribute PresentValue
 */
PacketBufferHandle encodeBinaryInputBasicClusterReadPresentValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBinaryInputBasicPresentValue", BinaryInputBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BinaryInputBasic::Attributes::Ids::PresentValue);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeBinaryInputBasicClusterWritePresentValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                           uint8_t presentValue)
{
    COMMAND_HEADER("WriteBinaryInputBasicPresentValue", BinaryInputBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(BinaryInputBasic::Attributes::Ids::PresentValue)
        .Put8(16)
        .Put8(static_cast<uint8_t>(presentValue));
    COMMAND_FOOTER();
}

PacketBufferHandle encodeBinaryInputBasicClusterConfigurePresentValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                               uint16_t minInterval, uint16_t maxInterval)
{
    COMMAND_HEADER("ReportBinaryInputBasicPresentValue", BinaryInputBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(BinaryInputBasic::Attributes::Ids::PresentValue)
        .Put8(16)
        .Put16(minInterval)
        .Put16(maxInterval);
    COMMAND_FOOTER();
}

/*
 * Attribute StatusFlags
 */
PacketBufferHandle encodeBinaryInputBasicClusterReadStatusFlagsAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBinaryInputBasicStatusFlags", BinaryInputBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BinaryInputBasic::Attributes::Ids::StatusFlags);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeBinaryInputBasicClusterConfigureStatusFlagsAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                              uint16_t minInterval, uint16_t maxInterval)
{
    COMMAND_HEADER("ReportBinaryInputBasicStatusFlags", BinaryInputBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(BinaryInputBasic::Attributes::Ids::StatusFlags)
        .Put8(24)
        .Put16(minInterval)
        .Put16(maxInterval);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeBinaryInputBasicClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBinaryInputBasicClusterRevision", BinaryInputBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster Binding                                                     | 0xF000 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Bind                                                              |   0x00 |
| * Unbind                                                            |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeBindingClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverBindingAttributes", Binding::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeBindingClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBindingClusterRevision", Binding::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster BridgedDeviceBasic                                          | 0x0039 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * VendorName                                                        | 0x0001 |
| * VendorID                                                          | 0x0002 |
| * ProductName                                                       | 0x0003 |
| * UserLabel                                                         | 0x0005 |
| * HardwareVersion                                                   | 0x0007 |
| * HardwareVersionString                                             | 0x0008 |
| * SoftwareVersion                                                   | 0x0009 |
| * SoftwareVersionString                                             | 0x000A |
| * ManufacturingDate                                                 | 0x000B |
| * PartNumber                                                        | 0x000C |
| * ProductURL                                                        | 0x000D |
| * ProductLabel                                                      | 0x000E |
| * SerialNumber                                                      | 0x000F |
| * Reachable                                                         | 0x0011 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeBridgedDeviceBasicClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverBridgedDeviceBasicAttributes", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute VendorName
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadVendorNameAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicVendorName", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::VendorName);
    COMMAND_FOOTER();
}

/*
 * Attribute VendorID
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadVendorIDAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicVendorID", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::VendorID);
    COMMAND_FOOTER();
}

/*
 * Attribute ProductName
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadProductNameAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicProductName", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::ProductName);
    COMMAND_FOOTER();
}

/*
 * Attribute UserLabel
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadUserLabelAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicUserLabel", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::UserLabel);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeBridgedDeviceBasicClusterWriteUserLabelAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                          chip::ByteSpan userLabel)
{
    COMMAND_HEADER("WriteBridgedDeviceBasicUserLabel", BridgedDeviceBasic::Id);
    size_t userLabelStrLen = userLabel.size();
    if (!CanCastTo<uint8_t>(userLabelStrLen))
    {
        ChipLogError(Zcl, "Error encoding %s command. String too long: %zu", kName, userLabelStrLen);
        return PacketBufferHandle();
    }

    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::UserLabel)
        .Put8(66)
        .Put(static_cast<uint8_t>(userLabelStrLen))
        .Put(userLabel.data(), userLabelStrLen);
    COMMAND_FOOTER();
}

/*
 * Attribute HardwareVersion
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadHardwareVersionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicHardwareVersion", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::HardwareVersion);
    COMMAND_FOOTER();
}

/*
 * Attribute HardwareVersionString
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadHardwareVersionStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicHardwareVersionString", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::HardwareVersionString);
    COMMAND_FOOTER();
}

/*
 * Attribute SoftwareVersion
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadSoftwareVersionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicSoftwareVersion", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::SoftwareVersion);
    COMMAND_FOOTER();
}

/*
 * Attribute SoftwareVersionString
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadSoftwareVersionStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicSoftwareVersionString", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::SoftwareVersionString);
    COMMAND_FOOTER();
}

/*
 * Attribute ManufacturingDate
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadManufacturingDateAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicManufacturingDate", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::ManufacturingDate);
    COMMAND_FOOTER();
}

/*
 * Attribute PartNumber
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadPartNumberAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicPartNumber", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::PartNumber);
    COMMAND_FOOTER();
}

/*
 * Attribute ProductURL
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadProductURLAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicProductURL", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::ProductURL);
    COMMAND_FOOTER();
}

/*
 * Attribute ProductLabel
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadProductLabelAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicProductLabel", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::ProductLabel);
    COMMAND_FOOTER();
}

/*
 * Attribute SerialNumber
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadSerialNumberAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicSerialNumber", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::SerialNumber);
    COMMAND_FOOTER();
}

/*
 * Attribute Reachable
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadReachableAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicReachable", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(BridgedDeviceBasic::Attributes::Ids::Reachable);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeBridgedDeviceBasicClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadBridgedDeviceBasicClusterRevision", BridgedDeviceBasic::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster ColorControl                                                | 0x0300 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ColorLoopSet                                                      |   0x44 |
| * EnhancedMoveHue                                                   |   0x41 |
| * EnhancedMoveToHue                                                 |   0x40 |
| * EnhancedMoveToHueAndSaturation                                    |   0x43 |
| * EnhancedStepHue                                                   |   0x42 |
| * MoveColor                                                         |   0x08 |
| * MoveColorTemperature                                              |   0x4B |
| * MoveHue                                                           |   0x01 |
| * MoveSaturation                                                    |   0x04 |
| * MoveToColor                                                       |   0x07 |
| * MoveToColorTemperature                                            |   0x0A |
| * MoveToHue                                                         |   0x00 |
| * MoveToHueAndSaturation                                            |   0x06 |
| * MoveToSaturation                                                  |   0x03 |
| * StepColor                                                         |   0x09 |
| * StepColorTemperature                                              |   0x4C |
| * StepHue                                                           |   0x02 |
| * StepSaturation                                                    |   0x05 |
| * StopMoveStep                                                      |   0x47 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * CurrentHue                                                        | 0x0000 |
| * CurrentSaturation                                                 | 0x0001 |
| * RemainingTime                                                     | 0x0002 |
| * CurrentX                                                          | 0x0003 |
| * CurrentY                                                          | 0x0004 |
| * DriftCompensation                                                 | 0x0005 |
| * CompensationText                                                  | 0x0006 |
| * ColorTemperature                                                  | 0x0007 |
| * ColorMode                                                         | 0x0008 |
| * ColorControlOptions                                               | 0x000F |
| * NumberOfPrimaries                                                 | 0x0010 |
| * Primary1X                                                         | 0x0011 |
| * Primary1Y                                                         | 0x0012 |
| * Primary1Intensity                                                 | 0x0013 |
| * Primary2X                                                         | 0x0015 |
| * Primary2Y                                                         | 0x0016 |
| * Primary2Intensity                                                 | 0x0017 |
| * Primary3X                                                         | 0x0019 |
| * Primary3Y                                                         | 0x001A |
| * Primary3Intensity                                                 | 0x001B |
| * Primary4X                                                         | 0x0020 |
| * Primary4Y                                                         | 0x0021 |
| * Primary4Intensity                                                 | 0x0022 |
| * Primary5X                                                         | 0x0024 |
| * Primary5Y                                                         | 0x0025 |
| * Primary5Intensity                                                 | 0x0026 |
| * Primary6X                                                         | 0x0028 |
| * Primary6Y                                                         | 0x0029 |
| * Primary6Intensity                                                 | 0x002A |
| * WhitePointX                                                       | 0x0030 |
| * WhitePointY                                                       | 0x0031 |
| * ColorPointRX                                                      | 0x0032 |
| * ColorPointRY                                                      | 0x0033 |
| * ColorPointRIntensity                                              | 0x0034 |
| * ColorPointGX                                                      | 0x0036 |
| * ColorPointGY                                                      | 0x0037 |
| * ColorPointGIntensity                                              | 0x0038 |
| * ColorPointBX                                                      | 0x003A |
| * ColorPointBY                                                      | 0x003B |
| * ColorPointBIntensity                                              | 0x003C |
| * EnhancedCurrentHue                                                | 0x4000 |
| * EnhancedColorMode                                                 | 0x4001 |
| * ColorLoopActive                                                   | 0x4002 |
| * ColorLoopDirection                                                | 0x4003 |
| * ColorLoopTime                                                     | 0x4004 |
| * ColorCapabilities                                                 | 0x400A |
| * ColorTempPhysicalMin                                              | 0x400B |
| * ColorTempPhysicalMax                                              | 0x400C |
| * CoupleColorTempToLevelMinMireds                                   | 0x400D |
| * StartUpColorTemperatureMireds                                     | 0x4010 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeColorControlClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverColorControlAttributes", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentHue
 */
PacketBufferHandle encodeColorControlClusterReadCurrentHueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlCurrentHue", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::CurrentHue);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterConfigureCurrentHueAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                         uint16_t minInterval, uint16_t maxInterval, uint8_t change)
{
    COMMAND_HEADER("ReportColorControlCurrentHue", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(ColorControl::Attributes::Ids::CurrentHue)
        .Put8(32)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put8(static_cast<uint8_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentSaturation
 */
PacketBufferHandle encodeColorControlClusterReadCurrentSaturationAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlCurrentSaturation", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::CurrentSaturation);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterConfigureCurrentSaturationAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                                uint16_t minInterval, uint16_t maxInterval,
                                                                                uint8_t change)
{
    COMMAND_HEADER("ReportColorControlCurrentSaturation", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(ColorControl::Attributes::Ids::CurrentSaturation)
        .Put8(32)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put8(static_cast<uint8_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute RemainingTime
 */
PacketBufferHandle encodeColorControlClusterReadRemainingTimeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlRemainingTime", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::RemainingTime);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentX
 */
PacketBufferHandle encodeColorControlClusterReadCurrentXAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlCurrentX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::CurrentX);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterConfigureCurrentXAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                       uint16_t minInterval, uint16_t maxInterval, uint16_t change)
{
    COMMAND_HEADER("ReportColorControlCurrentX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(ColorControl::Attributes::Ids::CurrentX)
        .Put8(33)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentY
 */
PacketBufferHandle encodeColorControlClusterReadCurrentYAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlCurrentY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::CurrentY);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterConfigureCurrentYAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                       uint16_t minInterval, uint16_t maxInterval, uint16_t change)
{
    COMMAND_HEADER("ReportColorControlCurrentY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(ColorControl::Attributes::Ids::CurrentY)
        .Put8(33)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute DriftCompensation
 */
PacketBufferHandle encodeColorControlClusterReadDriftCompensationAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlDriftCompensation", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::DriftCompensation);
    COMMAND_FOOTER();
}

/*
 * Attribute CompensationText
 */
PacketBufferHandle encodeColorControlClusterReadCompensationTextAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlCompensationText", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::CompensationText);
    COMMAND_FOOTER();
}

/*
 * Attribute ColorTemperature
 */
PacketBufferHandle encodeColorControlClusterReadColorTemperatureAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorTemperature", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorTemperature);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterConfigureColorTemperatureAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                               uint16_t minInterval, uint16_t maxInterval,
                                                                               uint16_t change)
{
    COMMAND_HEADER("ReportColorControlColorTemperature", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(ColorControl::Attributes::Ids::ColorTemperature)
        .Put8(33)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorMode
 */
PacketBufferHandle encodeColorControlClusterReadColorModeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorMode", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorMode);
    COMMAND_FOOTER();
}

/*
 * Attribute ColorControlOptions
 */
PacketBufferHandle encodeColorControlClusterReadColorControlOptionsAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorControlOptions", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorControlOptions);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorControlOptionsAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                              uint8_t colorControlOptions)
{
    COMMAND_HEADER("WriteColorControlColorControlOptions", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorControlOptions)
        .Put8(24)
        .Put8(static_cast<uint8_t>(colorControlOptions));
    COMMAND_FOOTER();
}

/*
 * Attribute NumberOfPrimaries
 */
PacketBufferHandle encodeColorControlClusterReadNumberOfPrimariesAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlNumberOfPrimaries", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::NumberOfPrimaries);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary1X
 */
PacketBufferHandle encodeColorControlClusterReadPrimary1XAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary1X", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary1X);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary1Y
 */
PacketBufferHandle encodeColorControlClusterReadPrimary1YAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary1Y", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary1Y);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary1Intensity
 */
PacketBufferHandle encodeColorControlClusterReadPrimary1IntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary1Intensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary1Intensity);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary2X
 */
PacketBufferHandle encodeColorControlClusterReadPrimary2XAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary2X", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary2X);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary2Y
 */
PacketBufferHandle encodeColorControlClusterReadPrimary2YAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary2Y", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary2Y);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary2Intensity
 */
PacketBufferHandle encodeColorControlClusterReadPrimary2IntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary2Intensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary2Intensity);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary3X
 */
PacketBufferHandle encodeColorControlClusterReadPrimary3XAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary3X", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary3X);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary3Y
 */
PacketBufferHandle encodeColorControlClusterReadPrimary3YAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary3Y", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary3Y);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary3Intensity
 */
PacketBufferHandle encodeColorControlClusterReadPrimary3IntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary3Intensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary3Intensity);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary4X
 */
PacketBufferHandle encodeColorControlClusterReadPrimary4XAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary4X", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary4X);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary4Y
 */
PacketBufferHandle encodeColorControlClusterReadPrimary4YAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary4Y", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary4Y);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary4Intensity
 */
PacketBufferHandle encodeColorControlClusterReadPrimary4IntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary4Intensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary4Intensity);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary5X
 */
PacketBufferHandle encodeColorControlClusterReadPrimary5XAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary5X", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary5X);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary5Y
 */
PacketBufferHandle encodeColorControlClusterReadPrimary5YAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary5Y", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary5Y);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary5Intensity
 */
PacketBufferHandle encodeColorControlClusterReadPrimary5IntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary5Intensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary5Intensity);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary6X
 */
PacketBufferHandle encodeColorControlClusterReadPrimary6XAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary6X", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary6X);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary6Y
 */
PacketBufferHandle encodeColorControlClusterReadPrimary6YAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary6Y", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary6Y);
    COMMAND_FOOTER();
}

/*
 * Attribute Primary6Intensity
 */
PacketBufferHandle encodeColorControlClusterReadPrimary6IntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlPrimary6Intensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::Primary6Intensity);
    COMMAND_FOOTER();
}

/*
 * Attribute WhitePointX
 */
PacketBufferHandle encodeColorControlClusterReadWhitePointXAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlWhitePointX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::WhitePointX);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteWhitePointXAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                      uint16_t whitePointX)
{
    COMMAND_HEADER("WriteColorControlWhitePointX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::WhitePointX)
        .Put8(33)
        .Put16(static_cast<uint16_t>(whitePointX));
    COMMAND_FOOTER();
}

/*
 * Attribute WhitePointY
 */
PacketBufferHandle encodeColorControlClusterReadWhitePointYAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlWhitePointY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::WhitePointY);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteWhitePointYAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                      uint16_t whitePointY)
{
    COMMAND_HEADER("WriteColorControlWhitePointY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::WhitePointY)
        .Put8(33)
        .Put16(static_cast<uint16_t>(whitePointY));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorPointRX
 */
PacketBufferHandle encodeColorControlClusterReadColorPointRXAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorPointRX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointRX);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorPointRXAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                       uint16_t colorPointRX)
{
    COMMAND_HEADER("WriteColorControlColorPointRX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointRX)
        .Put8(33)
        .Put16(static_cast<uint16_t>(colorPointRX));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorPointRY
 */
PacketBufferHandle encodeColorControlClusterReadColorPointRYAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorPointRY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointRY);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorPointRYAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                       uint16_t colorPointRY)
{
    COMMAND_HEADER("WriteColorControlColorPointRY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointRY)
        .Put8(33)
        .Put16(static_cast<uint16_t>(colorPointRY));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorPointRIntensity
 */
PacketBufferHandle encodeColorControlClusterReadColorPointRIntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorPointRIntensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointRIntensity);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorPointRIntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                               uint8_t colorPointRIntensity)
{
    COMMAND_HEADER("WriteColorControlColorPointRIntensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointRIntensity)
        .Put8(32)
        .Put8(static_cast<uint8_t>(colorPointRIntensity));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorPointGX
 */
PacketBufferHandle encodeColorControlClusterReadColorPointGXAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorPointGX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointGX);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorPointGXAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                       uint16_t colorPointGX)
{
    COMMAND_HEADER("WriteColorControlColorPointGX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointGX)
        .Put8(33)
        .Put16(static_cast<uint16_t>(colorPointGX));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorPointGY
 */
PacketBufferHandle encodeColorControlClusterReadColorPointGYAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorPointGY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointGY);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorPointGYAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                       uint16_t colorPointGY)
{
    COMMAND_HEADER("WriteColorControlColorPointGY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointGY)
        .Put8(33)
        .Put16(static_cast<uint16_t>(colorPointGY));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorPointGIntensity
 */
PacketBufferHandle encodeColorControlClusterReadColorPointGIntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorPointGIntensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointGIntensity);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorPointGIntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                               uint8_t colorPointGIntensity)
{
    COMMAND_HEADER("WriteColorControlColorPointGIntensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointGIntensity)
        .Put8(32)
        .Put8(static_cast<uint8_t>(colorPointGIntensity));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorPointBX
 */
PacketBufferHandle encodeColorControlClusterReadColorPointBXAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorPointBX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointBX);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorPointBXAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                       uint16_t colorPointBX)
{
    COMMAND_HEADER("WriteColorControlColorPointBX", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointBX)
        .Put8(33)
        .Put16(static_cast<uint16_t>(colorPointBX));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorPointBY
 */
PacketBufferHandle encodeColorControlClusterReadColorPointBYAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorPointBY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointBY);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorPointBYAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                       uint16_t colorPointBY)
{
    COMMAND_HEADER("WriteColorControlColorPointBY", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointBY)
        .Put8(33)
        .Put16(static_cast<uint16_t>(colorPointBY));
    COMMAND_FOOTER();
}

/*
 * Attribute ColorPointBIntensity
 */
PacketBufferHandle encodeColorControlClusterReadColorPointBIntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorPointBIntensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointBIntensity);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteColorPointBIntensityAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                               uint8_t colorPointBIntensity)
{
    COMMAND_HEADER("WriteColorControlColorPointBIntensity", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorPointBIntensity)
        .Put8(32)
        .Put8(static_cast<uint8_t>(colorPointBIntensity));
    COMMAND_FOOTER();
}

/*
 * Attribute EnhancedCurrentHue
 */
PacketBufferHandle encodeColorControlClusterReadEnhancedCurrentHueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlEnhancedCurrentHue", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::EnhancedCurrentHue);
    COMMAND_FOOTER();
}

/*
 * Attribute EnhancedColorMode
 */
PacketBufferHandle encodeColorControlClusterReadEnhancedColorModeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlEnhancedColorMode", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::EnhancedColorMode);
    COMMAND_FOOTER();
}

/*
 * Attribute ColorLoopActive
 */
PacketBufferHandle encodeColorControlClusterReadColorLoopActiveAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorLoopActive", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorLoopActive);
    COMMAND_FOOTER();
}

/*
 * Attribute ColorLoopDirection
 */
PacketBufferHandle encodeColorControlClusterReadColorLoopDirectionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorLoopDirection", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorLoopDirection);
    COMMAND_FOOTER();
}

/*
 * Attribute ColorLoopTime
 */
PacketBufferHandle encodeColorControlClusterReadColorLoopTimeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorLoopTime", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorLoopTime);
    COMMAND_FOOTER();
}

/*
 * Attribute ColorCapabilities
 */
PacketBufferHandle encodeColorControlClusterReadColorCapabilitiesAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorCapabilities", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorCapabilities);
    COMMAND_FOOTER();
}

/*
 * Attribute ColorTempPhysicalMin
 */
PacketBufferHandle encodeColorControlClusterReadColorTempPhysicalMinAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorTempPhysicalMin", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorTempPhysicalMin);
    COMMAND_FOOTER();
}

/*
 * Attribute ColorTempPhysicalMax
 */
PacketBufferHandle encodeColorControlClusterReadColorTempPhysicalMaxAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlColorTempPhysicalMax", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::ColorTempPhysicalMax);
    COMMAND_FOOTER();
}

/*
 * Attribute CoupleColorTempToLevelMinMireds
 */
PacketBufferHandle encodeColorControlClusterReadCoupleColorTempToLevelMinMiredsAttribute(uint8_t seqNum,
                                                                                         EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlCoupleColorTempToLevelMinMireds", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::CoupleColorTempToLevelMinMireds);
    COMMAND_FOOTER();
}

/*
 * Attribute StartUpColorTemperatureMireds
 */
PacketBufferHandle encodeColorControlClusterReadStartUpColorTemperatureMiredsAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlStartUpColorTemperatureMireds", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ColorControl::Attributes::Ids::StartUpColorTemperatureMireds);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeColorControlClusterWriteStartUpColorTemperatureMiredsAttribute(uint8_t seqNum,
                                                                                        EndpointId destinationEndpoint,
                                                                                        uint16_t startUpColorTemperatureMireds)
{
    COMMAND_HEADER("WriteColorControlStartUpColorTemperatureMireds", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(ColorControl::Attributes::Ids::StartUpColorTemperatureMireds)
        .Put8(33)
        .Put16(static_cast<uint16_t>(startUpColorTemperatureMireds));
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeColorControlClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadColorControlClusterRevision", ColorControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster ContentLauncher                                             | 0x050A |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * LaunchContent                                                     |   0x00 |
| * LaunchURL                                                         |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * AcceptsHeaderList                                                 | 0x0000 |
| * SupportedStreamingTypes                                           | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeContentLauncherClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverContentLauncherAttributes", ContentLauncher::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute AcceptsHeaderList
 */
PacketBufferHandle encodeContentLauncherClusterReadAcceptsHeaderListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadContentLauncherAcceptsHeaderList", ContentLauncher::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ContentLauncher::Attributes::Ids::AcceptsHeaderList);
    COMMAND_FOOTER();
}

/*
 * Attribute SupportedStreamingTypes
 */
PacketBufferHandle encodeContentLauncherClusterReadSupportedStreamingTypesAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadContentLauncherSupportedStreamingTypes", ContentLauncher::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ContentLauncher::Attributes::Ids::SupportedStreamingTypes);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeContentLauncherClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadContentLauncherClusterRevision", ContentLauncher::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster Descriptor                                                  | 0x001D |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * DeviceList                                                        | 0x0000 |
| * ServerList                                                        | 0x0001 |
| * ClientList                                                        | 0x0002 |
| * PartsList                                                         | 0x0003 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeDescriptorClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverDescriptorAttributes", Descriptor::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute DeviceList
 */
PacketBufferHandle encodeDescriptorClusterReadDeviceListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadDescriptorDeviceList", Descriptor::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Descriptor::Attributes::Ids::DeviceList);
    COMMAND_FOOTER();
}

/*
 * Attribute ServerList
 */
PacketBufferHandle encodeDescriptorClusterReadServerListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadDescriptorServerList", Descriptor::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Descriptor::Attributes::Ids::ServerList);
    COMMAND_FOOTER();
}

/*
 * Attribute ClientList
 */
PacketBufferHandle encodeDescriptorClusterReadClientListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadDescriptorClientList", Descriptor::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Descriptor::Attributes::Ids::ClientList);
    COMMAND_FOOTER();
}

/*
 * Attribute PartsList
 */
PacketBufferHandle encodeDescriptorClusterReadPartsListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadDescriptorPartsList", Descriptor::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Descriptor::Attributes::Ids::PartsList);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeDescriptorClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadDescriptorClusterRevision", Descriptor::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster DiagnosticLogs                                              | 0x0032 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * RetrieveLogsRequest                                               |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeDiagnosticLogsClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverDiagnosticLogsAttributes", DiagnosticLogs::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster DoorLock                                                    | 0x0101 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ClearAllPins                                                      |   0x08 |
| * ClearAllRfids                                                     |   0x19 |
| * ClearHolidaySchedule                                              |   0x13 |
| * ClearPin                                                          |   0x07 |
| * ClearRfid                                                         |   0x18 |
| * ClearWeekdaySchedule                                              |   0x0D |
| * ClearYeardaySchedule                                              |   0x10 |
| * GetHolidaySchedule                                                |   0x12 |
| * GetLogRecord                                                      |   0x04 |
| * GetPin                                                            |   0x06 |
| * GetRfid                                                           |   0x17 |
| * GetUserType                                                       |   0x15 |
| * GetWeekdaySchedule                                                |   0x0C |
| * GetYeardaySchedule                                                |   0x0F |
| * LockDoor                                                          |   0x00 |
| * SetHolidaySchedule                                                |   0x11 |
| * SetPin                                                            |   0x05 |
| * SetRfid                                                           |   0x16 |
| * SetUserType                                                       |   0x14 |
| * SetWeekdaySchedule                                                |   0x0B |
| * SetYeardaySchedule                                                |   0x0E |
| * UnlockDoor                                                        |   0x01 |
| * UnlockWithTimeout                                                 |   0x03 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * LockState                                                         | 0x0000 |
| * LockType                                                          | 0x0001 |
| * ActuatorEnabled                                                   | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeDoorLockClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverDoorLockAttributes", DoorLock::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute LockState
 */
PacketBufferHandle encodeDoorLockClusterReadLockStateAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadDoorLockLockState", DoorLock::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(DoorLock::Attributes::Ids::LockState);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeDoorLockClusterConfigureLockStateAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                    uint16_t minInterval, uint16_t maxInterval)
{
    COMMAND_HEADER("ReportDoorLockLockState", DoorLock::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(DoorLock::Attributes::Ids::LockState)
        .Put8(48)
        .Put16(minInterval)
        .Put16(maxInterval);
    COMMAND_FOOTER();
}

/*
 * Attribute LockType
 */
PacketBufferHandle encodeDoorLockClusterReadLockTypeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadDoorLockLockType", DoorLock::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(DoorLock::Attributes::Ids::LockType);
    COMMAND_FOOTER();
}

/*
 * Attribute ActuatorEnabled
 */
PacketBufferHandle encodeDoorLockClusterReadActuatorEnabledAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadDoorLockActuatorEnabled", DoorLock::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(DoorLock::Attributes::Ids::ActuatorEnabled);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeDoorLockClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadDoorLockClusterRevision", DoorLock::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster ElectricalMeasurement                                       | 0x0B04 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasurementType                                                   | 0x0000 |
| * TotalActivePower                                                  | 0x0304 |
| * RmsVoltage                                                        | 0x0505 |
| * RmsVoltageMin                                                     | 0x0506 |
| * RmsVoltageMax                                                     | 0x0507 |
| * RmsCurrent                                                        | 0x0508 |
| * RmsCurrentMin                                                     | 0x0509 |
| * RmsCurrentMax                                                     | 0x050A |
| * ActivePower                                                       | 0x050B |
| * ActivePowerMin                                                    | 0x050C |
| * ActivePowerMax                                                    | 0x050D |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeElectricalMeasurementClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverElectricalMeasurementAttributes", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute MeasurementType
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadMeasurementTypeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementMeasurementType", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::MeasurementType);
    COMMAND_FOOTER();
}

/*
 * Attribute TotalActivePower
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadTotalActivePowerAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementTotalActivePower", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::TotalActivePower);
    COMMAND_FOOTER();
}

/*
 * Attribute RmsVoltage
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadRmsVoltageAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementRmsVoltage", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::RmsVoltage);
    COMMAND_FOOTER();
}

/*
 * Attribute RmsVoltageMin
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadRmsVoltageMinAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementRmsVoltageMin", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::RmsVoltageMin);
    COMMAND_FOOTER();
}

/*
 * Attribute RmsVoltageMax
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadRmsVoltageMaxAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementRmsVoltageMax", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::RmsVoltageMax);
    COMMAND_FOOTER();
}

/*
 * Attribute RmsCurrent
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadRmsCurrentAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementRmsCurrent", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::RmsCurrent);
    COMMAND_FOOTER();
}

/*
 * Attribute RmsCurrentMin
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadRmsCurrentMinAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementRmsCurrentMin", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::RmsCurrentMin);
    COMMAND_FOOTER();
}

/*
 * Attribute RmsCurrentMax
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadRmsCurrentMaxAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementRmsCurrentMax", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::RmsCurrentMax);
    COMMAND_FOOTER();
}

/*
 * Attribute ActivePower
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadActivePowerAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementActivePower", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::ActivePower);
    COMMAND_FOOTER();
}

/*
 * Attribute ActivePowerMin
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadActivePowerMinAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementActivePowerMin", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::ActivePowerMin);
    COMMAND_FOOTER();
}

/*
 * Attribute ActivePowerMax
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadActivePowerMaxAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementActivePowerMax", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ElectricalMeasurement::Attributes::Ids::ActivePowerMax);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeElectricalMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadElectricalMeasurementClusterRevision", ElectricalMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster EthernetNetworkDiagnostics                                  | 0x0037 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ResetCounts                                                       |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * PacketRxCount                                                     | 0x0002 |
| * PacketTxCount                                                     | 0x0003 |
| * TxErrCount                                                        | 0x0004 |
| * CollisionCount                                                    | 0x0005 |
| * OverrunCount                                                      | 0x0006 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeEthernetNetworkDiagnosticsClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverEthernetNetworkDiagnosticsAttributes", EthernetNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute PacketRxCount
 */
PacketBufferHandle encodeEthernetNetworkDiagnosticsClusterReadPacketRxCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadEthernetNetworkDiagnosticsPacketRxCount", EthernetNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(EthernetNetworkDiagnostics::Attributes::Ids::PacketRxCount);
    COMMAND_FOOTER();
}

/*
 * Attribute PacketTxCount
 */
PacketBufferHandle encodeEthernetNetworkDiagnosticsClusterReadPacketTxCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadEthernetNetworkDiagnosticsPacketTxCount", EthernetNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(EthernetNetworkDiagnostics::Attributes::Ids::PacketTxCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxErrCount
 */
PacketBufferHandle encodeEthernetNetworkDiagnosticsClusterReadTxErrCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadEthernetNetworkDiagnosticsTxErrCount", EthernetNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(EthernetNetworkDiagnostics::Attributes::Ids::TxErrCount);
    COMMAND_FOOTER();
}

/*
 * Attribute CollisionCount
 */
PacketBufferHandle encodeEthernetNetworkDiagnosticsClusterReadCollisionCountAttribute(uint8_t seqNum,
                                                                                      EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadEthernetNetworkDiagnosticsCollisionCount", EthernetNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(EthernetNetworkDiagnostics::Attributes::Ids::CollisionCount);
    COMMAND_FOOTER();
}

/*
 * Attribute OverrunCount
 */
PacketBufferHandle encodeEthernetNetworkDiagnosticsClusterReadOverrunCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadEthernetNetworkDiagnosticsOverrunCount", EthernetNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(EthernetNetworkDiagnostics::Attributes::Ids::OverrunCount);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeEthernetNetworkDiagnosticsClusterReadClusterRevisionAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadEthernetNetworkDiagnosticsClusterRevision", EthernetNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster FixedLabel                                                  | 0x0040 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * LabelList                                                         | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeFixedLabelClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverFixedLabelAttributes", FixedLabel::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute LabelList
 */
PacketBufferHandle encodeFixedLabelClusterReadLabelListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadFixedLabelLabelList", FixedLabel::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(FixedLabel::Attributes::Ids::LabelList);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeFixedLabelClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadFixedLabelClusterRevision", FixedLabel::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster FlowMeasurement                                             | 0x0404 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasuredValue                                                     | 0x0000 |
| * MinMeasuredValue                                                  | 0x0001 |
| * MaxMeasuredValue                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeFlowMeasurementClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverFlowMeasurementAttributes", FlowMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute MeasuredValue
 */
PacketBufferHandle encodeFlowMeasurementClusterReadMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadFlowMeasurementMeasuredValue", FlowMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(FlowMeasurement::Attributes::Ids::MeasuredValue);
    COMMAND_FOOTER();
}

/*
 * Attribute MinMeasuredValue
 */
PacketBufferHandle encodeFlowMeasurementClusterReadMinMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadFlowMeasurementMinMeasuredValue", FlowMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(FlowMeasurement::Attributes::Ids::MinMeasuredValue);
    COMMAND_FOOTER();
}

/*
 * Attribute MaxMeasuredValue
 */
PacketBufferHandle encodeFlowMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadFlowMeasurementMaxMeasuredValue", FlowMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(FlowMeasurement::Attributes::Ids::MaxMeasuredValue);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeFlowMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadFlowMeasurementClusterRevision", FlowMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster GeneralCommissioning                                        | 0x0030 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ArmFailSafe                                                       |   0x00 |
| * CommissioningComplete                                             |   0x04 |
| * SetRegulatoryConfig                                               |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * FabricId                                                          | 0x0000 |
| * Breadcrumb                                                        | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeGeneralCommissioningClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverGeneralCommissioningAttributes", GeneralCommissioning::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute FabricId
 */
PacketBufferHandle encodeGeneralCommissioningClusterReadFabricIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGeneralCommissioningFabricId", GeneralCommissioning::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(GeneralCommissioning::Attributes::Ids::FabricId);
    COMMAND_FOOTER();
}

/*
 * Attribute Breadcrumb
 */
PacketBufferHandle encodeGeneralCommissioningClusterReadBreadcrumbAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGeneralCommissioningBreadcrumb", GeneralCommissioning::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(GeneralCommissioning::Attributes::Ids::Breadcrumb);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeGeneralCommissioningClusterWriteBreadcrumbAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                             uint64_t breadcrumb)
{
    COMMAND_HEADER("WriteGeneralCommissioningBreadcrumb", GeneralCommissioning::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(GeneralCommissioning::Attributes::Ids::Breadcrumb)
        .Put8(39)
        .Put64(static_cast<uint64_t>(breadcrumb));
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeGeneralCommissioningClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGeneralCommissioningClusterRevision", GeneralCommissioning::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster GeneralDiagnostics                                          | 0x0033 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * NetworkInterfaces                                                 | 0x0000 |
| * RebootCount                                                       | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeGeneralDiagnosticsClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverGeneralDiagnosticsAttributes", GeneralDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute NetworkInterfaces
 */
PacketBufferHandle encodeGeneralDiagnosticsClusterReadNetworkInterfacesAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGeneralDiagnosticsNetworkInterfaces", GeneralDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(GeneralDiagnostics::Attributes::Ids::NetworkInterfaces);
    COMMAND_FOOTER();
}

/*
 * Attribute RebootCount
 */
PacketBufferHandle encodeGeneralDiagnosticsClusterReadRebootCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGeneralDiagnosticsRebootCount", GeneralDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(GeneralDiagnostics::Attributes::Ids::RebootCount);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeGeneralDiagnosticsClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGeneralDiagnosticsClusterRevision", GeneralDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster GroupKeyManagement                                          | 0xF004 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Groups                                                            | 0x0000 |
| * GroupKeys                                                         | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeGroupKeyManagementClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverGroupKeyManagementAttributes", GroupKeyManagement::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute Groups
 */
PacketBufferHandle encodeGroupKeyManagementClusterReadGroupsAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGroupKeyManagementGroups", GroupKeyManagement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(GroupKeyManagement::Attributes::Ids::Groups);
    COMMAND_FOOTER();
}

/*
 * Attribute GroupKeys
 */
PacketBufferHandle encodeGroupKeyManagementClusterReadGroupKeysAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGroupKeyManagementGroupKeys", GroupKeyManagement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(GroupKeyManagement::Attributes::Ids::GroupKeys);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeGroupKeyManagementClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGroupKeyManagementClusterRevision", GroupKeyManagement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster Groups                                                      | 0x0004 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddGroup                                                          |   0x00 |
| * AddGroupIfIdentifying                                             |   0x05 |
| * GetGroupMembership                                                |   0x02 |
| * RemoveAllGroups                                                   |   0x04 |
| * RemoveGroup                                                       |   0x03 |
| * ViewGroup                                                         |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * NameSupport                                                       | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeGroupsClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverGroupsAttributes", Groups::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute NameSupport
 */
PacketBufferHandle encodeGroupsClusterReadNameSupportAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGroupsNameSupport", Groups::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Groups::Attributes::Ids::NameSupport);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeGroupsClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadGroupsClusterRevision", Groups::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster Identify                                                    | 0x0003 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Identify                                                          |   0x00 |
| * IdentifyQuery                                                     |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * IdentifyTime                                                      | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeIdentifyClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverIdentifyAttributes", Identify::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute IdentifyTime
 */
PacketBufferHandle encodeIdentifyClusterReadIdentifyTimeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadIdentifyIdentifyTime", Identify::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Identify::Attributes::Ids::IdentifyTime);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeIdentifyClusterWriteIdentifyTimeAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                   uint16_t identifyTime)
{
    COMMAND_HEADER("WriteIdentifyIdentifyTime", Identify::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(Identify::Attributes::Ids::IdentifyTime)
        .Put8(33)
        .Put16(static_cast<uint16_t>(identifyTime));
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeIdentifyClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadIdentifyClusterRevision", Identify::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster KeypadInput                                                 | 0x0509 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * SendKey                                                           |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeKeypadInputClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverKeypadInputAttributes", KeypadInput::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeKeypadInputClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadKeypadInputClusterRevision", KeypadInput::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster LevelControl                                                | 0x0008 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Move                                                              |   0x01 |
| * MoveToLevel                                                       |   0x00 |
| * MoveToLevelWithOnOff                                              |   0x04 |
| * MoveWithOnOff                                                     |   0x05 |
| * Step                                                              |   0x02 |
| * StepWithOnOff                                                     |   0x06 |
| * Stop                                                              |   0x03 |
| * StopWithOnOff                                                     |   0x07 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * CurrentLevel                                                      | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeLevelControlClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverLevelControlAttributes", LevelControl::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentLevel
 */
PacketBufferHandle encodeLevelControlClusterReadCurrentLevelAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadLevelControlCurrentLevel", LevelControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(LevelControl::Attributes::Ids::CurrentLevel);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeLevelControlClusterConfigureCurrentLevelAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                           uint16_t minInterval, uint16_t maxInterval,
                                                                           uint8_t change)
{
    COMMAND_HEADER("ReportLevelControlCurrentLevel", LevelControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(LevelControl::Attributes::Ids::CurrentLevel)
        .Put8(32)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put8(static_cast<uint8_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeLevelControlClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadLevelControlClusterRevision", LevelControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster LowPower                                                    | 0x0508 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Sleep                                                             |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeLowPowerClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverLowPowerAttributes", LowPower::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeLowPowerClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadLowPowerClusterRevision", LowPower::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster MediaInput                                                  | 0x0507 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * HideInputStatus                                                   |   0x02 |
| * RenameInput                                                       |   0x03 |
| * SelectInput                                                       |   0x00 |
| * ShowInputStatus                                                   |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MediaInputList                                                    | 0x0000 |
| * CurrentMediaInput                                                 | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeMediaInputClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverMediaInputAttributes", MediaInput::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute MediaInputList
 */
PacketBufferHandle encodeMediaInputClusterReadMediaInputListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadMediaInputMediaInputList", MediaInput::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(MediaInput::Attributes::Ids::MediaInputList);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentMediaInput
 */
PacketBufferHandle encodeMediaInputClusterReadCurrentMediaInputAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadMediaInputCurrentMediaInput", MediaInput::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(MediaInput::Attributes::Ids::CurrentMediaInput);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeMediaInputClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadMediaInputClusterRevision", MediaInput::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster MediaPlayback                                               | 0x0506 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * MediaFastForward                                                  |   0x07 |
| * MediaNext                                                         |   0x05 |
| * MediaPause                                                        |   0x01 |
| * MediaPlay                                                         |   0x00 |
| * MediaPrevious                                                     |   0x04 |
| * MediaRewind                                                       |   0x06 |
| * MediaSeek                                                         |   0x0A |
| * MediaSkipBackward                                                 |   0x09 |
| * MediaSkipForward                                                  |   0x08 |
| * MediaStartOver                                                    |   0x03 |
| * MediaStop                                                         |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeMediaPlaybackClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverMediaPlaybackAttributes", MediaPlayback::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeMediaPlaybackClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadMediaPlaybackClusterRevision", MediaPlayback::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster NetworkCommissioning                                        | 0x0031 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddThreadNetwork                                                  |   0x06 |
| * AddWiFiNetwork                                                    |   0x02 |
| * DisableNetwork                                                    |   0x0E |
| * EnableNetwork                                                     |   0x0C |
| * GetLastNetworkCommissioningResult                                 |   0x10 |
| * RemoveNetwork                                                     |   0x0A |
| * ScanNetworks                                                      |   0x00 |
| * UpdateThreadNetwork                                               |   0x08 |
| * UpdateWiFiNetwork                                                 |   0x04 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeNetworkCommissioningClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverNetworkCommissioningAttributes", NetworkCommissioning::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeNetworkCommissioningClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadNetworkCommissioningClusterRevision", NetworkCommissioning::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster OtaSoftwareUpdateProvider                                   | 0x0029 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ApplyUpdateRequest                                                |   0x01 |
| * NotifyUpdateApplied                                               |   0x02 |
| * QueryImage                                                        |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeOtaSoftwareUpdateProviderClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverOtaSoftwareUpdateProviderAttributes", OtaSoftwareUpdateProvider::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeOtaSoftwareUpdateProviderClusterReadClusterRevisionAttribute(uint8_t seqNum,
                                                                                      EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOtaSoftwareUpdateProviderClusterRevision", OtaSoftwareUpdateProvider::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster OccupancySensing                                            | 0x0406 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Occupancy                                                         | 0x0000 |
| * OccupancySensorType                                               | 0x0001 |
| * OccupancySensorTypeBitmap                                         | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeOccupancySensingClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverOccupancySensingAttributes", OccupancySensing::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute Occupancy
 */
PacketBufferHandle encodeOccupancySensingClusterReadOccupancyAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOccupancySensingOccupancy", OccupancySensing::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(OccupancySensing::Attributes::Ids::Occupancy);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeOccupancySensingClusterConfigureOccupancyAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                            uint16_t minInterval, uint16_t maxInterval)
{
    COMMAND_HEADER("ReportOccupancySensingOccupancy", OccupancySensing::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(OccupancySensing::Attributes::Ids::Occupancy)
        .Put8(24)
        .Put16(minInterval)
        .Put16(maxInterval);
    COMMAND_FOOTER();
}

/*
 * Attribute OccupancySensorType
 */
PacketBufferHandle encodeOccupancySensingClusterReadOccupancySensorTypeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOccupancySensingOccupancySensorType", OccupancySensing::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(OccupancySensing::Attributes::Ids::OccupancySensorType);
    COMMAND_FOOTER();
}

/*
 * Attribute OccupancySensorTypeBitmap
 */
PacketBufferHandle encodeOccupancySensingClusterReadOccupancySensorTypeBitmapAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOccupancySensingOccupancySensorTypeBitmap", OccupancySensing::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(OccupancySensing::Attributes::Ids::OccupancySensorTypeBitmap);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeOccupancySensingClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOccupancySensingClusterRevision", OccupancySensing::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster OnOff                                                       | 0x0006 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Off                                                               |   0x00 |
| * On                                                                |   0x01 |
| * Toggle                                                            |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * OnOff                                                             | 0x0000 |
| * GlobalSceneControl                                                | 0x4000 |
| * OnTime                                                            | 0x4001 |
| * OffWaitTime                                                       | 0x4002 |
| * StartUpOnOff                                                      | 0x4003 |
| * FeatureMap                                                        | 0xFFFC |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeOnOffClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverOnOffAttributes", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute OnOff
 */
PacketBufferHandle encodeOnOffClusterReadOnOffAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOnOffOnOff", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(OnOff::Attributes::Ids::OnOff);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeOnOffClusterConfigureOnOffAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t minInterval,
                                                             uint16_t maxInterval)
{
    COMMAND_HEADER("ReportOnOffOnOff", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(OnOff::Attributes::Ids::OnOff)
        .Put8(16)
        .Put16(minInterval)
        .Put16(maxInterval);
    COMMAND_FOOTER();
}

/*
 * Attribute GlobalSceneControl
 */
PacketBufferHandle encodeOnOffClusterReadGlobalSceneControlAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOnOffGlobalSceneControl", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(OnOff::Attributes::Ids::GlobalSceneControl);
    COMMAND_FOOTER();
}

/*
 * Attribute OnTime
 */
PacketBufferHandle encodeOnOffClusterReadOnTimeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOnOffOnTime", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(OnOff::Attributes::Ids::OnTime);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeOnOffClusterWriteOnTimeAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t onTime)
{
    COMMAND_HEADER("WriteOnOffOnTime", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(OnOff::Attributes::Ids::OnTime)
        .Put8(33)
        .Put16(static_cast<uint16_t>(onTime));
    COMMAND_FOOTER();
}

/*
 * Attribute OffWaitTime
 */
PacketBufferHandle encodeOnOffClusterReadOffWaitTimeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOnOffOffWaitTime", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(OnOff::Attributes::Ids::OffWaitTime);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeOnOffClusterWriteOffWaitTimeAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t offWaitTime)
{
    COMMAND_HEADER("WriteOnOffOffWaitTime", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(OnOff::Attributes::Ids::OffWaitTime)
        .Put8(33)
        .Put16(static_cast<uint16_t>(offWaitTime));
    COMMAND_FOOTER();
}

/*
 * Attribute StartUpOnOff
 */
PacketBufferHandle encodeOnOffClusterReadStartUpOnOffAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOnOffStartUpOnOff", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(OnOff::Attributes::Ids::StartUpOnOff);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeOnOffClusterWriteStartUpOnOffAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                uint8_t startUpOnOff)
{
    COMMAND_HEADER("WriteOnOffStartUpOnOff", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(OnOff::Attributes::Ids::StartUpOnOff)
        .Put8(48)
        .Put8(static_cast<uint8_t>(startUpOnOff));
    COMMAND_FOOTER();
}

/*
 * Attribute FeatureMap
 */
PacketBufferHandle encodeOnOffClusterReadFeatureMapAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOnOffFeatureMap", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::FeatureMap);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeOnOffClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOnOffClusterRevision", OnOff::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster OperationalCredentials                                      | 0x003E |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddOpCert                                                         |   0x06 |
| * AddTrustedRootCertificate                                         |   0xA1 |
| * OpCSRRequest                                                      |   0x04 |
| * RemoveAllFabrics                                                  |   0x0B |
| * RemoveFabric                                                      |   0x0A |
| * RemoveTrustedRootCertificate                                      |   0xA2 |
| * SetFabric                                                         |   0x00 |
| * UpdateFabricLabel                                                 |   0x09 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * FabricsList                                                       | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeOperationalCredentialsClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverOperationalCredentialsAttributes", OperationalCredentials::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute FabricsList
 */
PacketBufferHandle encodeOperationalCredentialsClusterReadFabricsListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOperationalCredentialsFabricsList", OperationalCredentials::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(OperationalCredentials::Attributes::Ids::FabricsList);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeOperationalCredentialsClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadOperationalCredentialsClusterRevision", OperationalCredentials::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster PressureMeasurement                                         | 0x0403 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasuredValue                                                     | 0x0000 |
| * MinMeasuredValue                                                  | 0x0001 |
| * MaxMeasuredValue                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodePressureMeasurementClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverPressureMeasurementAttributes", PressureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute MeasuredValue
 */
PacketBufferHandle encodePressureMeasurementClusterReadMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPressureMeasurementMeasuredValue", PressureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PressureMeasurement::Attributes::Ids::MeasuredValue);
    COMMAND_FOOTER();
}

PacketBufferHandle encodePressureMeasurementClusterConfigureMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                                   uint16_t minInterval, uint16_t maxInterval,
                                                                                   int16_t change)
{
    COMMAND_HEADER("ReportPressureMeasurementMeasuredValue", PressureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(PressureMeasurement::Attributes::Ids::MeasuredValue)
        .Put8(41)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute MinMeasuredValue
 */
PacketBufferHandle encodePressureMeasurementClusterReadMinMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPressureMeasurementMinMeasuredValue", PressureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PressureMeasurement::Attributes::Ids::MinMeasuredValue);
    COMMAND_FOOTER();
}

/*
 * Attribute MaxMeasuredValue
 */
PacketBufferHandle encodePressureMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPressureMeasurementMaxMeasuredValue", PressureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PressureMeasurement::Attributes::Ids::MaxMeasuredValue);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodePressureMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPressureMeasurementClusterRevision", PressureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster PumpConfigurationAndControl                                 | 0x0200 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MaxPressure                                                       | 0x0000 |
| * MaxSpeed                                                          | 0x0001 |
| * MaxFlow                                                           | 0x0002 |
| * EffectiveOperationMode                                            | 0x0011 |
| * EffectiveControlMode                                              | 0x0012 |
| * Capacity                                                          | 0x0013 |
| * OperationMode                                                     | 0x0020 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodePumpConfigurationAndControlClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverPumpConfigurationAndControlAttributes", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute MaxPressure
 */
PacketBufferHandle encodePumpConfigurationAndControlClusterReadMaxPressureAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPumpConfigurationAndControlMaxPressure", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PumpConfigurationAndControl::Attributes::Ids::MaxPressure);
    COMMAND_FOOTER();
}

/*
 * Attribute MaxSpeed
 */
PacketBufferHandle encodePumpConfigurationAndControlClusterReadMaxSpeedAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPumpConfigurationAndControlMaxSpeed", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PumpConfigurationAndControl::Attributes::Ids::MaxSpeed);
    COMMAND_FOOTER();
}

/*
 * Attribute MaxFlow
 */
PacketBufferHandle encodePumpConfigurationAndControlClusterReadMaxFlowAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPumpConfigurationAndControlMaxFlow", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PumpConfigurationAndControl::Attributes::Ids::MaxFlow);
    COMMAND_FOOTER();
}

/*
 * Attribute EffectiveOperationMode
 */
PacketBufferHandle encodePumpConfigurationAndControlClusterReadEffectiveOperationModeAttribute(uint8_t seqNum,
                                                                                               EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPumpConfigurationAndControlEffectiveOperationMode", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PumpConfigurationAndControl::Attributes::Ids::EffectiveOperationMode);
    COMMAND_FOOTER();
}

/*
 * Attribute EffectiveControlMode
 */
PacketBufferHandle encodePumpConfigurationAndControlClusterReadEffectiveControlModeAttribute(uint8_t seqNum,
                                                                                             EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPumpConfigurationAndControlEffectiveControlMode", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PumpConfigurationAndControl::Attributes::Ids::EffectiveControlMode);
    COMMAND_FOOTER();
}

/*
 * Attribute Capacity
 */
PacketBufferHandle encodePumpConfigurationAndControlClusterReadCapacityAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPumpConfigurationAndControlCapacity", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PumpConfigurationAndControl::Attributes::Ids::Capacity);
    COMMAND_FOOTER();
}

PacketBufferHandle encodePumpConfigurationAndControlClusterConfigureCapacityAttribute(uint8_t seqNum,
                                                                                      EndpointId destinationEndpoint,
                                                                                      uint16_t minInterval, uint16_t maxInterval,
                                                                                      int16_t change)
{
    COMMAND_HEADER("ReportPumpConfigurationAndControlCapacity", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(PumpConfigurationAndControl::Attributes::Ids::Capacity)
        .Put8(41)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute OperationMode
 */
PacketBufferHandle encodePumpConfigurationAndControlClusterReadOperationModeAttribute(uint8_t seqNum,
                                                                                      EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPumpConfigurationAndControlOperationMode", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(PumpConfigurationAndControl::Attributes::Ids::OperationMode);
    COMMAND_FOOTER();
}

PacketBufferHandle encodePumpConfigurationAndControlClusterWriteOperationModeAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint,
                                                                                       uint8_t operationMode)
{
    COMMAND_HEADER("WritePumpConfigurationAndControlOperationMode", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(PumpConfigurationAndControl::Attributes::Ids::OperationMode)
        .Put8(48)
        .Put8(static_cast<uint8_t>(operationMode));
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodePumpConfigurationAndControlClusterReadClusterRevisionAttribute(uint8_t seqNum,
                                                                                        EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadPumpConfigurationAndControlClusterRevision", PumpConfigurationAndControl::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster RelativeHumidityMeasurement                                 | 0x0405 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasuredValue                                                     | 0x0000 |
| * MinMeasuredValue                                                  | 0x0001 |
| * MaxMeasuredValue                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeRelativeHumidityMeasurementClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverRelativeHumidityMeasurementAttributes", RelativeHumidityMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute MeasuredValue
 */
PacketBufferHandle encodeRelativeHumidityMeasurementClusterReadMeasuredValueAttribute(uint8_t seqNum,
                                                                                      EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadRelativeHumidityMeasurementMeasuredValue", RelativeHumidityMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(RelativeHumidityMeasurement::Attributes::Ids::MeasuredValue);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeRelativeHumidityMeasurementClusterConfigureMeasuredValueAttribute(uint8_t seqNum,
                                                                                           EndpointId destinationEndpoint,
                                                                                           uint16_t minInterval,
                                                                                           uint16_t maxInterval, uint16_t change)
{
    COMMAND_HEADER("ReportRelativeHumidityMeasurementMeasuredValue", RelativeHumidityMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(RelativeHumidityMeasurement::Attributes::Ids::MeasuredValue)
        .Put8(33)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute MinMeasuredValue
 */
PacketBufferHandle encodeRelativeHumidityMeasurementClusterReadMinMeasuredValueAttribute(uint8_t seqNum,
                                                                                         EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadRelativeHumidityMeasurementMinMeasuredValue", RelativeHumidityMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(RelativeHumidityMeasurement::Attributes::Ids::MinMeasuredValue);
    COMMAND_FOOTER();
}

/*
 * Attribute MaxMeasuredValue
 */
PacketBufferHandle encodeRelativeHumidityMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum,
                                                                                         EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadRelativeHumidityMeasurementMaxMeasuredValue", RelativeHumidityMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(RelativeHumidityMeasurement::Attributes::Ids::MaxMeasuredValue);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeRelativeHumidityMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum,
                                                                                        EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadRelativeHumidityMeasurementClusterRevision", RelativeHumidityMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster Scenes                                                      | 0x0005 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * AddScene                                                          |   0x00 |
| * GetSceneMembership                                                |   0x06 |
| * RecallScene                                                       |   0x05 |
| * RemoveAllScenes                                                   |   0x03 |
| * RemoveScene                                                       |   0x02 |
| * StoreScene                                                        |   0x04 |
| * ViewScene                                                         |   0x01 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * SceneCount                                                        | 0x0000 |
| * CurrentScene                                                      | 0x0001 |
| * CurrentGroup                                                      | 0x0002 |
| * SceneValid                                                        | 0x0003 |
| * NameSupport                                                       | 0x0004 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeScenesClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverScenesAttributes", Scenes::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute SceneCount
 */
PacketBufferHandle encodeScenesClusterReadSceneCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadScenesSceneCount", Scenes::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Scenes::Attributes::Ids::SceneCount);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentScene
 */
PacketBufferHandle encodeScenesClusterReadCurrentSceneAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadScenesCurrentScene", Scenes::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Scenes::Attributes::Ids::CurrentScene);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentGroup
 */
PacketBufferHandle encodeScenesClusterReadCurrentGroupAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadScenesCurrentGroup", Scenes::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Scenes::Attributes::Ids::CurrentGroup);
    COMMAND_FOOTER();
}

/*
 * Attribute SceneValid
 */
PacketBufferHandle encodeScenesClusterReadSceneValidAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadScenesSceneValid", Scenes::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Scenes::Attributes::Ids::SceneValid);
    COMMAND_FOOTER();
}

/*
 * Attribute NameSupport
 */
PacketBufferHandle encodeScenesClusterReadNameSupportAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadScenesNameSupport", Scenes::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Scenes::Attributes::Ids::NameSupport);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeScenesClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadScenesClusterRevision", Scenes::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster SoftwareDiagnostics                                         | 0x0034 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ResetWatermarks                                                   |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * CurrentHeapHighWatermark                                          | 0x0003 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeSoftwareDiagnosticsClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverSoftwareDiagnosticsAttributes", SoftwareDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentHeapHighWatermark
 */
PacketBufferHandle encodeSoftwareDiagnosticsClusterReadCurrentHeapHighWatermarkAttribute(uint8_t seqNum,
                                                                                         EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadSoftwareDiagnosticsCurrentHeapHighWatermark", SoftwareDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(SoftwareDiagnostics::Attributes::Ids::CurrentHeapHighWatermark);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeSoftwareDiagnosticsClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadSoftwareDiagnosticsClusterRevision", SoftwareDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster Switch                                                      | 0x003B |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * NumberOfPositions                                                 | 0x0000 |
| * CurrentPosition                                                   | 0x0001 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeSwitchClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverSwitchAttributes", Switch::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute NumberOfPositions
 */
PacketBufferHandle encodeSwitchClusterReadNumberOfPositionsAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadSwitchNumberOfPositions", Switch::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Switch::Attributes::Ids::NumberOfPositions);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentPosition
 */
PacketBufferHandle encodeSwitchClusterReadCurrentPositionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadSwitchCurrentPosition", Switch::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Switch::Attributes::Ids::CurrentPosition);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeSwitchClusterConfigureCurrentPositionAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                        uint16_t minInterval, uint16_t maxInterval, uint8_t change)
{
    COMMAND_HEADER("ReportSwitchCurrentPosition", Switch::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(Switch::Attributes::Ids::CurrentPosition)
        .Put8(32)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put8(static_cast<uint8_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeSwitchClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadSwitchClusterRevision", Switch::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster TvChannel                                                   | 0x0504 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ChangeChannel                                                     |   0x00 |
| * ChangeChannelByNumber                                             |   0x01 |
| * SkipChannel                                                       |   0x02 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * TvChannelList                                                     | 0x0000 |
| * TvChannelLineup                                                   | 0x0001 |
| * CurrentTvChannel                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeTvChannelClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverTvChannelAttributes", TvChannel::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute TvChannelList
 */
PacketBufferHandle encodeTvChannelClusterReadTvChannelListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTvChannelTvChannelList", TvChannel::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TvChannel::Attributes::Ids::TvChannelList);
    COMMAND_FOOTER();
}

/*
 * Attribute TvChannelLineup
 */
PacketBufferHandle encodeTvChannelClusterReadTvChannelLineupAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTvChannelTvChannelLineup", TvChannel::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TvChannel::Attributes::Ids::TvChannelLineup);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentTvChannel
 */
PacketBufferHandle encodeTvChannelClusterReadCurrentTvChannelAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTvChannelCurrentTvChannel", TvChannel::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TvChannel::Attributes::Ids::CurrentTvChannel);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeTvChannelClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTvChannelClusterRevision", TvChannel::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster TargetNavigator                                             | 0x0505 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * NavigateTarget                                                    |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * TargetNavigatorList                                               | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeTargetNavigatorClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverTargetNavigatorAttributes", TargetNavigator::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute TargetNavigatorList
 */
PacketBufferHandle encodeTargetNavigatorClusterReadTargetNavigatorListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTargetNavigatorTargetNavigatorList", TargetNavigator::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TargetNavigator::Attributes::Ids::TargetNavigatorList);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeTargetNavigatorClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTargetNavigatorClusterRevision", TargetNavigator::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster TemperatureMeasurement                                      | 0x0402 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * MeasuredValue                                                     | 0x0000 |
| * MinMeasuredValue                                                  | 0x0001 |
| * MaxMeasuredValue                                                  | 0x0002 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeTemperatureMeasurementClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverTemperatureMeasurementAttributes", TemperatureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute MeasuredValue
 */
PacketBufferHandle encodeTemperatureMeasurementClusterReadMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTemperatureMeasurementMeasuredValue", TemperatureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TemperatureMeasurement::Attributes::Ids::MeasuredValue);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTemperatureMeasurementClusterConfigureMeasuredValueAttribute(uint8_t seqNum,
                                                                                      EndpointId destinationEndpoint,
                                                                                      uint16_t minInterval, uint16_t maxInterval,
                                                                                      int16_t change)
{
    COMMAND_HEADER("ReportTemperatureMeasurementMeasuredValue", TemperatureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(TemperatureMeasurement::Attributes::Ids::MeasuredValue)
        .Put8(41)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute MinMeasuredValue
 */
PacketBufferHandle encodeTemperatureMeasurementClusterReadMinMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTemperatureMeasurementMinMeasuredValue", TemperatureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TemperatureMeasurement::Attributes::Ids::MinMeasuredValue);
    COMMAND_FOOTER();
}

/*
 * Attribute MaxMeasuredValue
 */
PacketBufferHandle encodeTemperatureMeasurementClusterReadMaxMeasuredValueAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTemperatureMeasurementMaxMeasuredValue", TemperatureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TemperatureMeasurement::Attributes::Ids::MaxMeasuredValue);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeTemperatureMeasurementClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTemperatureMeasurementClusterRevision", TemperatureMeasurement::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster TestCluster                                                 | 0x050F |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * Test                                                              |   0x00 |
| * TestNotHandled                                                    |   0x01 |
| * TestSpecific                                                      |   0x02 |
| * TestUnknownCommand                                                |   0x03 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Boolean                                                           | 0x0000 |
| * Bitmap8                                                           | 0x0001 |
| * Bitmap16                                                          | 0x0002 |
| * Bitmap32                                                          | 0x0003 |
| * Bitmap64                                                          | 0x0004 |
| * Int8u                                                             | 0x0005 |
| * Int16u                                                            | 0x0006 |
| * Int32u                                                            | 0x0008 |
| * Int64u                                                            | 0x000C |
| * Int8s                                                             | 0x000D |
| * Int16s                                                            | 0x000E |
| * Int32s                                                            | 0x0010 |
| * Int64s                                                            | 0x0014 |
| * Enum8                                                             | 0x0015 |
| * Enum16                                                            | 0x0016 |
| * OctetString                                                       | 0x0019 |
| * ListInt8u                                                         | 0x001A |
| * ListOctetString                                                   | 0x001B |
| * ListStructOctetString                                             | 0x001C |
| * LongOctetString                                                   | 0x001D |
| * Unsupported                                                       | 0x00FF |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeTestClusterClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverTestClusterAttributes", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute Boolean
 */
PacketBufferHandle encodeTestClusterClusterReadBooleanAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterBoolean", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Boolean);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteBooleanAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t boolean)
{
    COMMAND_HEADER("WriteTestClusterBoolean", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Boolean)
        .Put8(16)
        .Put8(static_cast<uint8_t>(boolean));
    COMMAND_FOOTER();
}

/*
 * Attribute Bitmap8
 */
PacketBufferHandle encodeTestClusterClusterReadBitmap8Attribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterBitmap8", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Bitmap8);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteBitmap8Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t bitmap8)
{
    COMMAND_HEADER("WriteTestClusterBitmap8", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Bitmap8)
        .Put8(24)
        .Put8(static_cast<uint8_t>(bitmap8));
    COMMAND_FOOTER();
}

/*
 * Attribute Bitmap16
 */
PacketBufferHandle encodeTestClusterClusterReadBitmap16Attribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterBitmap16", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Bitmap16);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteBitmap16Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t bitmap16)
{
    COMMAND_HEADER("WriteTestClusterBitmap16", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Bitmap16)
        .Put8(25)
        .Put16(static_cast<uint16_t>(bitmap16));
    COMMAND_FOOTER();
}

/*
 * Attribute Bitmap32
 */
PacketBufferHandle encodeTestClusterClusterReadBitmap32Attribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterBitmap32", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Bitmap32);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteBitmap32Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint32_t bitmap32)
{
    COMMAND_HEADER("WriteTestClusterBitmap32", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Bitmap32)
        .Put8(27)
        .Put32(static_cast<uint32_t>(bitmap32));
    COMMAND_FOOTER();
}

/*
 * Attribute Bitmap64
 */
PacketBufferHandle encodeTestClusterClusterReadBitmap64Attribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterBitmap64", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Bitmap64);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteBitmap64Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint64_t bitmap64)
{
    COMMAND_HEADER("WriteTestClusterBitmap64", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Bitmap64)
        .Put8(31)
        .Put64(static_cast<uint64_t>(bitmap64));
    COMMAND_FOOTER();
}

/*
 * Attribute Int8u
 */
PacketBufferHandle encodeTestClusterClusterReadInt8uAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterInt8u", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Int8u);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteInt8uAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t int8u)
{
    COMMAND_HEADER("WriteTestClusterInt8u", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Int8u)
        .Put8(32)
        .Put8(static_cast<uint8_t>(int8u));
    COMMAND_FOOTER();
}

/*
 * Attribute Int16u
 */
PacketBufferHandle encodeTestClusterClusterReadInt16uAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterInt16u", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Int16u);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteInt16uAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t int16u)
{
    COMMAND_HEADER("WriteTestClusterInt16u", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Int16u)
        .Put8(33)
        .Put16(static_cast<uint16_t>(int16u));
    COMMAND_FOOTER();
}

/*
 * Attribute Int32u
 */
PacketBufferHandle encodeTestClusterClusterReadInt32uAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterInt32u", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Int32u);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteInt32uAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint32_t int32u)
{
    COMMAND_HEADER("WriteTestClusterInt32u", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Int32u)
        .Put8(35)
        .Put32(static_cast<uint32_t>(int32u));
    COMMAND_FOOTER();
}

/*
 * Attribute Int64u
 */
PacketBufferHandle encodeTestClusterClusterReadInt64uAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterInt64u", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Int64u);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteInt64uAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint64_t int64u)
{
    COMMAND_HEADER("WriteTestClusterInt64u", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Int64u)
        .Put8(39)
        .Put64(static_cast<uint64_t>(int64u));
    COMMAND_FOOTER();
}

/*
 * Attribute Int8s
 */
PacketBufferHandle encodeTestClusterClusterReadInt8sAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterInt8s", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Int8s);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteInt8sAttribute(uint8_t seqNum, EndpointId destinationEndpoint, int8_t int8s)
{
    COMMAND_HEADER("WriteTestClusterInt8s", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Int8s)
        .Put8(40)
        .Put8(static_cast<uint8_t>(int8s));
    COMMAND_FOOTER();
}

/*
 * Attribute Int16s
 */
PacketBufferHandle encodeTestClusterClusterReadInt16sAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterInt16s", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Int16s);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteInt16sAttribute(uint8_t seqNum, EndpointId destinationEndpoint, int16_t int16s)
{
    COMMAND_HEADER("WriteTestClusterInt16s", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Int16s)
        .Put8(41)
        .Put16(static_cast<uint16_t>(int16s));
    COMMAND_FOOTER();
}

/*
 * Attribute Int32s
 */
PacketBufferHandle encodeTestClusterClusterReadInt32sAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterInt32s", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Int32s);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteInt32sAttribute(uint8_t seqNum, EndpointId destinationEndpoint, int32_t int32s)
{
    COMMAND_HEADER("WriteTestClusterInt32s", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Int32s)
        .Put8(43)
        .Put32(static_cast<uint32_t>(int32s));
    COMMAND_FOOTER();
}

/*
 * Attribute Int64s
 */
PacketBufferHandle encodeTestClusterClusterReadInt64sAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterInt64s", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Int64s);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteInt64sAttribute(uint8_t seqNum, EndpointId destinationEndpoint, int64_t int64s)
{
    COMMAND_HEADER("WriteTestClusterInt64s", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Int64s)
        .Put8(47)
        .Put64(static_cast<uint64_t>(int64s));
    COMMAND_FOOTER();
}

/*
 * Attribute Enum8
 */
PacketBufferHandle encodeTestClusterClusterReadEnum8Attribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterEnum8", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Enum8);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteEnum8Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t enum8)
{
    COMMAND_HEADER("WriteTestClusterEnum8", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Enum8)
        .Put8(48)
        .Put8(static_cast<uint8_t>(enum8));
    COMMAND_FOOTER();
}

/*
 * Attribute Enum16
 */
PacketBufferHandle encodeTestClusterClusterReadEnum16Attribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterEnum16", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Enum16);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteEnum16Attribute(uint8_t seqNum, EndpointId destinationEndpoint, uint16_t enum16)
{
    COMMAND_HEADER("WriteTestClusterEnum16", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Enum16)
        .Put8(49)
        .Put16(static_cast<uint16_t>(enum16));
    COMMAND_FOOTER();
}

/*
 * Attribute OctetString
 */
PacketBufferHandle encodeTestClusterClusterReadOctetStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterOctetString", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::OctetString);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteOctetStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                     chip::ByteSpan octetString)
{
    COMMAND_HEADER("WriteTestClusterOctetString", TestCluster::Id);
    size_t octetStringStrLen = octetString.size();
    if (!CanCastTo<uint8_t>(octetStringStrLen))
    {
        ChipLogError(Zcl, "Error encoding %s command. String too long: %zu", kName, octetStringStrLen);
        return PacketBufferHandle();
    }

    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::OctetString)
        .Put8(65)
        .Put(static_cast<uint8_t>(octetStringStrLen))
        .Put(octetString.data(), octetStringStrLen);
    COMMAND_FOOTER();
}

/*
 * Attribute ListInt8u
 */
PacketBufferHandle encodeTestClusterClusterReadListInt8uAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterListInt8u", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::ListInt8u);
    COMMAND_FOOTER();
}

/*
 * Attribute ListOctetString
 */
PacketBufferHandle encodeTestClusterClusterReadListOctetStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterListOctetString", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::ListOctetString);
    COMMAND_FOOTER();
}

/*
 * Attribute ListStructOctetString
 */
PacketBufferHandle encodeTestClusterClusterReadListStructOctetStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterListStructOctetString", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::ListStructOctetString);
    COMMAND_FOOTER();
}

/*
 * Attribute LongOctetString
 */
PacketBufferHandle encodeTestClusterClusterReadLongOctetStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterLongOctetString", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::LongOctetString);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteLongOctetStringAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                         chip::ByteSpan longOctetString)
{
    COMMAND_HEADER("WriteTestClusterLongOctetString", TestCluster::Id);
    size_t longOctetStringStrLen = longOctetString.size();
    if (!CanCastTo<uint16_t>(longOctetStringStrLen))
    {
        ChipLogError(Zcl, "Error encoding %s command. String too long: %zu", kName, longOctetStringStrLen);
        return PacketBufferHandle();
    }

    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::LongOctetString)
        .Put8(67)
        .Put16(static_cast<uint16_t>(longOctetStringStrLen))
        .Put(longOctetString.data(), longOctetStringStrLen);
    COMMAND_FOOTER();
}

/*
 * Attribute Unsupported
 */
PacketBufferHandle encodeTestClusterClusterReadUnsupportedAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterUnsupported", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(TestCluster::Attributes::Ids::Unsupported);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeTestClusterClusterWriteUnsupportedAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                     uint8_t unsupported)
{
    COMMAND_HEADER("WriteTestClusterUnsupported", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(TestCluster::Attributes::Ids::Unsupported)
        .Put8(16)
        .Put8(static_cast<uint8_t>(unsupported));
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeTestClusterClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadTestClusterClusterRevision", TestCluster::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster Thermostat                                                  | 0x0201 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ClearWeeklySchedule                                               |   0x03 |
| * GetRelayStatusLog                                                 |   0x04 |
| * GetWeeklySchedule                                                 |   0x02 |
| * SetWeeklySchedule                                                 |   0x01 |
| * SetpointRaiseLower                                                |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * LocalTemperature                                                  | 0x0000 |
| * OccupiedCoolingSetpoint                                           | 0x0011 |
| * OccupiedHeatingSetpoint                                           | 0x0012 |
| * ControlSequenceOfOperation                                        | 0x001B |
| * SystemMode                                                        | 0x001C |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeThermostatClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverThermostatAttributes", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute LocalTemperature
 */
PacketBufferHandle encodeThermostatClusterReadLocalTemperatureAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThermostatLocalTemperature", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Thermostat::Attributes::Ids::LocalTemperature);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeThermostatClusterConfigureLocalTemperatureAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                             uint16_t minInterval, uint16_t maxInterval,
                                                                             int16_t change)
{
    COMMAND_HEADER("ReportThermostatLocalTemperature", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(Thermostat::Attributes::Ids::LocalTemperature)
        .Put8(41)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute OccupiedCoolingSetpoint
 */
PacketBufferHandle encodeThermostatClusterReadOccupiedCoolingSetpointAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThermostatOccupiedCoolingSetpoint", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Thermostat::Attributes::Ids::OccupiedCoolingSetpoint);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeThermostatClusterWriteOccupiedCoolingSetpointAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                                int16_t occupiedCoolingSetpoint)
{
    COMMAND_HEADER("WriteThermostatOccupiedCoolingSetpoint", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(Thermostat::Attributes::Ids::OccupiedCoolingSetpoint)
        .Put8(41)
        .Put16(static_cast<uint16_t>(occupiedCoolingSetpoint));
    COMMAND_FOOTER();
}

/*
 * Attribute OccupiedHeatingSetpoint
 */
PacketBufferHandle encodeThermostatClusterReadOccupiedHeatingSetpointAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThermostatOccupiedHeatingSetpoint", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Thermostat::Attributes::Ids::OccupiedHeatingSetpoint);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeThermostatClusterWriteOccupiedHeatingSetpointAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                                int16_t occupiedHeatingSetpoint)
{
    COMMAND_HEADER("WriteThermostatOccupiedHeatingSetpoint", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(Thermostat::Attributes::Ids::OccupiedHeatingSetpoint)
        .Put8(41)
        .Put16(static_cast<uint16_t>(occupiedHeatingSetpoint));
    COMMAND_FOOTER();
}

/*
 * Attribute ControlSequenceOfOperation
 */
PacketBufferHandle encodeThermostatClusterReadControlSequenceOfOperationAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThermostatControlSequenceOfOperation", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Thermostat::Attributes::Ids::ControlSequenceOfOperation);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeThermostatClusterWriteControlSequenceOfOperationAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                                   uint8_t controlSequenceOfOperation)
{
    COMMAND_HEADER("WriteThermostatControlSequenceOfOperation", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(Thermostat::Attributes::Ids::ControlSequenceOfOperation)
        .Put8(48)
        .Put8(static_cast<uint8_t>(controlSequenceOfOperation));
    COMMAND_FOOTER();
}

/*
 * Attribute SystemMode
 */
PacketBufferHandle encodeThermostatClusterReadSystemModeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThermostatSystemMode", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Thermostat::Attributes::Ids::SystemMode);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeThermostatClusterWriteSystemModeAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                   uint8_t systemMode)
{
    COMMAND_HEADER("WriteThermostatSystemMode", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(Thermostat::Attributes::Ids::SystemMode)
        .Put8(48)
        .Put8(static_cast<uint8_t>(systemMode));
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeThermostatClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThermostatClusterRevision", Thermostat::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster ThreadNetworkDiagnostics                                    | 0x0035 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * ResetCounts                                                       |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Channel                                                           | 0x0000 |
| * RoutingRole                                                       | 0x0001 |
| * NetworkName                                                       | 0x0002 |
| * PanId                                                             | 0x0003 |
| * ExtendedPanId                                                     | 0x0004 |
| * MeshLocalPrefix                                                   | 0x0005 |
| * OverrunCount                                                      | 0x0006 |
| * NeighborTableList                                                 | 0x0007 |
| * RouteTableList                                                    | 0x0008 |
| * PartitionId                                                       | 0x0009 |
| * Weighting                                                         | 0x000A |
| * DataVersion                                                       | 0x000B |
| * StableDataVersion                                                 | 0x000C |
| * LeaderRouterId                                                    | 0x000D |
| * DetachedRoleCount                                                 | 0x000E |
| * ChildRoleCount                                                    | 0x000F |
| * RouterRoleCount                                                   | 0x0010 |
| * LeaderRoleCount                                                   | 0x0011 |
| * AttachAttemptCount                                                | 0x0012 |
| * PartitionIdChangeCount                                            | 0x0013 |
| * BetterPartitionAttachAttemptCount                                 | 0x0014 |
| * ParentChangeCount                                                 | 0x0015 |
| * TxTotalCount                                                      | 0x0016 |
| * TxUnicastCount                                                    | 0x0017 |
| * TxBroadcastCount                                                  | 0x0018 |
| * TxAckRequestedCount                                               | 0x0019 |
| * TxAckedCount                                                      | 0x001A |
| * TxNoAckRequestedCount                                             | 0x001B |
| * TxDataCount                                                       | 0x001C |
| * TxDataPollCount                                                   | 0x001D |
| * TxBeaconCount                                                     | 0x001E |
| * TxBeaconRequestCount                                              | 0x001F |
| * TxOtherCount                                                      | 0x0020 |
| * TxRetryCount                                                      | 0x0021 |
| * TxDirectMaxRetryExpiryCount                                       | 0x0022 |
| * TxIndirectMaxRetryExpiryCount                                     | 0x0023 |
| * TxErrCcaCount                                                     | 0x0024 |
| * TxErrAbortCount                                                   | 0x0025 |
| * TxErrBusyChannelCount                                             | 0x0026 |
| * RxTotalCount                                                      | 0x0027 |
| * RxUnicastCount                                                    | 0x0028 |
| * RxBroadcastCount                                                  | 0x0029 |
| * RxDataCount                                                       | 0x002A |
| * RxDataPollCount                                                   | 0x002B |
| * RxBeaconCount                                                     | 0x002C |
| * RxBeaconRequestCount                                              | 0x002D |
| * RxOtherCount                                                      | 0x002E |
| * RxAddressFilteredCount                                            | 0x002F |
| * RxDestAddrFilteredCount                                           | 0x0030 |
| * RxDuplicatedCount                                                 | 0x0031 |
| * RxErrNoFrameCount                                                 | 0x0032 |
| * RxErrUnknownNeighborCount                                         | 0x0033 |
| * RxErrInvalidSrcAddrCount                                          | 0x0034 |
| * RxErrSecCount                                                     | 0x0035 |
| * RxErrFcsCount                                                     | 0x0036 |
| * RxErrOtherCount                                                   | 0x0037 |
| * SecurityPolicy                                                    | 0x003B |
| * ChannelMask                                                       | 0x003C |
| * OperationalDatasetComponents                                      | 0x003D |
| * ActiveNetworkFaultsList                                           | 0x003E |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeThreadNetworkDiagnosticsClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverThreadNetworkDiagnosticsAttributes", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute Channel
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadChannelAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsChannel", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::Channel);
    COMMAND_FOOTER();
}

/*
 * Attribute RoutingRole
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRoutingRoleAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRoutingRole", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RoutingRole);
    COMMAND_FOOTER();
}

/*
 * Attribute NetworkName
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadNetworkNameAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsNetworkName", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::NetworkName);
    COMMAND_FOOTER();
}

/*
 * Attribute PanId
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadPanIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsPanId", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::PanId);
    COMMAND_FOOTER();
}

/*
 * Attribute ExtendedPanId
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadExtendedPanIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsExtendedPanId", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::ExtendedPanId);
    COMMAND_FOOTER();
}

/*
 * Attribute MeshLocalPrefix
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadMeshLocalPrefixAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsMeshLocalPrefix", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::MeshLocalPrefix);
    COMMAND_FOOTER();
}

/*
 * Attribute OverrunCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadOverrunCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsOverrunCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::OverrunCount);
    COMMAND_FOOTER();
}

/*
 * Attribute NeighborTableList
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadNeighborTableListAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsNeighborTableList", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::NeighborTableList);
    COMMAND_FOOTER();
}

/*
 * Attribute RouteTableList
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRouteTableListAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRouteTableList", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RouteTableList);
    COMMAND_FOOTER();
}

/*
 * Attribute PartitionId
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadPartitionIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsPartitionId", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::PartitionId);
    COMMAND_FOOTER();
}

/*
 * Attribute Weighting
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadWeightingAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsWeighting", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::Weighting);
    COMMAND_FOOTER();
}

/*
 * Attribute DataVersion
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadDataVersionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsDataVersion", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::DataVersion);
    COMMAND_FOOTER();
}

/*
 * Attribute StableDataVersion
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadStableDataVersionAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsStableDataVersion", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::StableDataVersion);
    COMMAND_FOOTER();
}

/*
 * Attribute LeaderRouterId
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadLeaderRouterIdAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsLeaderRouterId", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::LeaderRouterId);
    COMMAND_FOOTER();
}

/*
 * Attribute DetachedRoleCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadDetachedRoleCountAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsDetachedRoleCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::DetachedRoleCount);
    COMMAND_FOOTER();
}

/*
 * Attribute ChildRoleCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadChildRoleCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsChildRoleCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::ChildRoleCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RouterRoleCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRouterRoleCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRouterRoleCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RouterRoleCount);
    COMMAND_FOOTER();
}

/*
 * Attribute LeaderRoleCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadLeaderRoleCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsLeaderRoleCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::LeaderRoleCount);
    COMMAND_FOOTER();
}

/*
 * Attribute AttachAttemptCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadAttachAttemptCountAttribute(uint8_t seqNum,
                                                                                        EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsAttachAttemptCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::AttachAttemptCount);
    COMMAND_FOOTER();
}

/*
 * Attribute PartitionIdChangeCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadPartitionIdChangeCountAttribute(uint8_t seqNum,
                                                                                            EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsPartitionIdChangeCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::PartitionIdChangeCount);
    COMMAND_FOOTER();
}

/*
 * Attribute BetterPartitionAttachAttemptCount
 */
PacketBufferHandle
encodeThreadNetworkDiagnosticsClusterReadBetterPartitionAttachAttemptCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsBetterPartitionAttachAttemptCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::BetterPartitionAttachAttemptCount);
    COMMAND_FOOTER();
}

/*
 * Attribute ParentChangeCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadParentChangeCountAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsParentChangeCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::ParentChangeCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxTotalCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxTotalCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxTotalCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxTotalCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxUnicastCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxUnicastCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxUnicastCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxUnicastCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxBroadcastCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxBroadcastCountAttribute(uint8_t seqNum,
                                                                                      EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxBroadcastCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxBroadcastCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxAckRequestedCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxAckRequestedCountAttribute(uint8_t seqNum,
                                                                                         EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxAckRequestedCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxAckRequestedCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxAckedCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxAckedCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxAckedCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxAckedCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxNoAckRequestedCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxNoAckRequestedCountAttribute(uint8_t seqNum,
                                                                                           EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxNoAckRequestedCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxNoAckRequestedCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxDataCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxDataCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxDataCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxDataCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxDataPollCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxDataPollCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxDataPollCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxDataPollCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxBeaconCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxBeaconCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxBeaconCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxBeaconCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxBeaconRequestCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxBeaconRequestCountAttribute(uint8_t seqNum,
                                                                                          EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxBeaconRequestCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxBeaconRequestCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxOtherCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxOtherCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxOtherCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxOtherCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxRetryCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxRetryCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxRetryCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxRetryCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxDirectMaxRetryExpiryCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxDirectMaxRetryExpiryCountAttribute(uint8_t seqNum,
                                                                                                 EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxDirectMaxRetryExpiryCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxDirectMaxRetryExpiryCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxIndirectMaxRetryExpiryCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxIndirectMaxRetryExpiryCountAttribute(uint8_t seqNum,
                                                                                                   EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxIndirectMaxRetryExpiryCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxIndirectMaxRetryExpiryCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxErrCcaCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxErrCcaCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxErrCcaCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxErrCcaCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxErrAbortCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxErrAbortCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxErrAbortCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxErrAbortCount);
    COMMAND_FOOTER();
}

/*
 * Attribute TxErrBusyChannelCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadTxErrBusyChannelCountAttribute(uint8_t seqNum,
                                                                                           EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsTxErrBusyChannelCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::TxErrBusyChannelCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxTotalCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxTotalCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxTotalCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxTotalCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxUnicastCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxUnicastCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxUnicastCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxUnicastCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxBroadcastCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxBroadcastCountAttribute(uint8_t seqNum,
                                                                                      EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxBroadcastCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxBroadcastCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxDataCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxDataCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxDataCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxDataCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxDataPollCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxDataPollCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxDataPollCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxDataPollCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxBeaconCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxBeaconCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxBeaconCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxBeaconCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxBeaconRequestCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxBeaconRequestCountAttribute(uint8_t seqNum,
                                                                                          EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxBeaconRequestCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxBeaconRequestCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxOtherCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxOtherCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxOtherCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxOtherCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxAddressFilteredCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxAddressFilteredCountAttribute(uint8_t seqNum,
                                                                                            EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxAddressFilteredCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxAddressFilteredCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxDestAddrFilteredCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxDestAddrFilteredCountAttribute(uint8_t seqNum,
                                                                                             EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxDestAddrFilteredCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxDestAddrFilteredCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxDuplicatedCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxDuplicatedCountAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxDuplicatedCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxDuplicatedCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxErrNoFrameCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxErrNoFrameCountAttribute(uint8_t seqNum,
                                                                                       EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxErrNoFrameCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxErrNoFrameCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxErrUnknownNeighborCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxErrUnknownNeighborCountAttribute(uint8_t seqNum,
                                                                                               EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxErrUnknownNeighborCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxErrUnknownNeighborCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxErrInvalidSrcAddrCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxErrInvalidSrcAddrCountAttribute(uint8_t seqNum,
                                                                                              EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxErrInvalidSrcAddrCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxErrInvalidSrcAddrCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxErrSecCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxErrSecCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxErrSecCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxErrSecCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxErrFcsCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxErrFcsCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxErrFcsCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxErrFcsCount);
    COMMAND_FOOTER();
}

/*
 * Attribute RxErrOtherCount
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadRxErrOtherCountAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsRxErrOtherCount", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::RxErrOtherCount);
    COMMAND_FOOTER();
}

/*
 * Attribute SecurityPolicy
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadSecurityPolicyAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsSecurityPolicy", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::SecurityPolicy);
    COMMAND_FOOTER();
}

/*
 * Attribute ChannelMask
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadChannelMaskAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsChannelMask", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::ChannelMask);
    COMMAND_FOOTER();
}

/*
 * Attribute OperationalDatasetComponents
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadOperationalDatasetComponentsAttribute(uint8_t seqNum,
                                                                                                  EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsOperationalDatasetComponents", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::OperationalDatasetComponents);
    COMMAND_FOOTER();
}

/*
 * Attribute ActiveNetworkFaultsList
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadActiveNetworkFaultsListAttribute(uint8_t seqNum,
                                                                                             EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsActiveNetworkFaultsList", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(ThreadNetworkDiagnostics::Attributes::Ids::ActiveNetworkFaultsList);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeThreadNetworkDiagnosticsClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadThreadNetworkDiagnosticsClusterRevision", ThreadNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster WakeOnLan                                                   | 0x0503 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * WakeOnLanMacAddress                                               | 0x0000 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeWakeOnLanClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverWakeOnLanAttributes", WakeOnLan::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute WakeOnLanMacAddress
 */
PacketBufferHandle encodeWakeOnLanClusterReadWakeOnLanMacAddressAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWakeOnLanWakeOnLanMacAddress", WakeOnLan::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WakeOnLan::Attributes::Ids::WakeOnLanMacAddress);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeWakeOnLanClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWakeOnLanClusterRevision", WakeOnLan::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster WiFiNetworkDiagnostics                                      | 0x0036 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Bssid                                                             | 0x0000 |
| * SecurityType                                                      | 0x0001 |
| * WiFiVersion                                                       | 0x0002 |
| * ChannelNumber                                                     | 0x0003 |
| * Rssi                                                              | 0x0004 |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeWiFiNetworkDiagnosticsClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverWiFiNetworkDiagnosticsAttributes", WiFiNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute Bssid
 */
PacketBufferHandle encodeWiFiNetworkDiagnosticsClusterReadBssidAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWiFiNetworkDiagnosticsBssid", WiFiNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WiFiNetworkDiagnostics::Attributes::Ids::Bssid);
    COMMAND_FOOTER();
}

/*
 * Attribute SecurityType
 */
PacketBufferHandle encodeWiFiNetworkDiagnosticsClusterReadSecurityTypeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWiFiNetworkDiagnosticsSecurityType", WiFiNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WiFiNetworkDiagnostics::Attributes::Ids::SecurityType);
    COMMAND_FOOTER();
}

/*
 * Attribute WiFiVersion
 */
PacketBufferHandle encodeWiFiNetworkDiagnosticsClusterReadWiFiVersionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWiFiNetworkDiagnosticsWiFiVersion", WiFiNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WiFiNetworkDiagnostics::Attributes::Ids::WiFiVersion);
    COMMAND_FOOTER();
}

/*
 * Attribute ChannelNumber
 */
PacketBufferHandle encodeWiFiNetworkDiagnosticsClusterReadChannelNumberAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWiFiNetworkDiagnosticsChannelNumber", WiFiNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WiFiNetworkDiagnostics::Attributes::Ids::ChannelNumber);
    COMMAND_FOOTER();
}

/*
 * Attribute Rssi
 */
PacketBufferHandle encodeWiFiNetworkDiagnosticsClusterReadRssiAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWiFiNetworkDiagnosticsRssi", WiFiNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WiFiNetworkDiagnostics::Attributes::Ids::Rssi);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeWiFiNetworkDiagnosticsClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWiFiNetworkDiagnosticsClusterRevision", WiFiNetworkDiagnostics::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}

/*----------------------------------------------------------------------------*\
| Cluster WindowCovering                                              | 0x0102 |
|------------------------------------------------------------------------------|
| Commands:                                                           |        |
| * DownOrClose                                                       |   0x01 |
| * GoToLiftPercentage                                                |   0x05 |
| * GoToLiftValue                                                     |   0x04 |
| * GoToTiltPercentage                                                |   0x08 |
| * GoToTiltValue                                                     |   0x07 |
| * StopMotion                                                        |   0x02 |
| * UpOrOpen                                                          |   0x00 |
|------------------------------------------------------------------------------|
| Attributes:                                                         |        |
| * Type                                                              | 0x0000 |
| * CurrentPositionLift                                               | 0x0003 |
| * CurrentPositionTilt                                               | 0x0004 |
| * ConfigStatus                                                      | 0x0007 |
| * CurrentPositionLiftPercentage                                     | 0x0008 |
| * CurrentPositionTiltPercentage                                     | 0x0009 |
| * OperationalStatus                                                 | 0x000A |
| * TargetPositionLiftPercent100ths                                   | 0x000B |
| * TargetPositionTiltPercent100ths                                   | 0x000C |
| * EndProductType                                                    | 0x000D |
| * CurrentPositionLiftPercent100ths                                  | 0x000E |
| * CurrentPositionTiltPercent100ths                                  | 0x000F |
| * InstalledOpenLimitLift                                            | 0x0010 |
| * InstalledClosedLimitLift                                          | 0x0011 |
| * InstalledOpenLimitTilt                                            | 0x0012 |
| * InstalledClosedLimitTilt                                          | 0x0013 |
| * Mode                                                              | 0x0017 |
| * SafetyStatus                                                      | 0x001A |
| * ClusterRevision                                                   | 0xFFFD |
\*----------------------------------------------------------------------------*/

PacketBufferHandle encodeWindowCoveringClusterDiscoverAttributes(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("DiscoverWindowCoveringAttributes", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand).Put8(seqNum).Put32(Globals::Commands::Ids::DiscoverAttributes).Put32(0x0000).Put8(0xFF);
    COMMAND_FOOTER();
}

/*
 * Attribute Type
 */
PacketBufferHandle encodeWindowCoveringClusterReadTypeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringType", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::Type);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentPositionLift
 */
PacketBufferHandle encodeWindowCoveringClusterReadCurrentPositionLiftAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringCurrentPositionLift", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionLift);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentPositionTilt
 */
PacketBufferHandle encodeWindowCoveringClusterReadCurrentPositionTiltAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringCurrentPositionTilt", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionTilt);
    COMMAND_FOOTER();
}

/*
 * Attribute ConfigStatus
 */
PacketBufferHandle encodeWindowCoveringClusterReadConfigStatusAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringConfigStatus", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::ConfigStatus);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentPositionLiftPercentage
 */
PacketBufferHandle encodeWindowCoveringClusterReadCurrentPositionLiftPercentageAttribute(uint8_t seqNum,
                                                                                         EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringCurrentPositionLiftPercentage", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionLiftPercentage);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeWindowCoveringClusterConfigureCurrentPositionLiftPercentageAttribute(uint8_t seqNum,
                                                                                              EndpointId destinationEndpoint,
                                                                                              uint16_t minInterval,
                                                                                              uint16_t maxInterval, uint8_t change)
{
    COMMAND_HEADER("ReportWindowCoveringCurrentPositionLiftPercentage", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionLiftPercentage)
        .Put8(32)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put8(static_cast<uint8_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentPositionTiltPercentage
 */
PacketBufferHandle encodeWindowCoveringClusterReadCurrentPositionTiltPercentageAttribute(uint8_t seqNum,
                                                                                         EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringCurrentPositionTiltPercentage", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionTiltPercentage);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeWindowCoveringClusterConfigureCurrentPositionTiltPercentageAttribute(uint8_t seqNum,
                                                                                              EndpointId destinationEndpoint,
                                                                                              uint16_t minInterval,
                                                                                              uint16_t maxInterval, uint8_t change)
{
    COMMAND_HEADER("ReportWindowCoveringCurrentPositionTiltPercentage", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionTiltPercentage)
        .Put8(32)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put8(static_cast<uint8_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute OperationalStatus
 */
PacketBufferHandle encodeWindowCoveringClusterReadOperationalStatusAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringOperationalStatus", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::OperationalStatus);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeWindowCoveringClusterConfigureOperationalStatusAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                                  uint16_t minInterval, uint16_t maxInterval)
{
    COMMAND_HEADER("ReportWindowCoveringOperationalStatus", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(WindowCovering::Attributes::Ids::OperationalStatus)
        .Put8(24)
        .Put16(minInterval)
        .Put16(maxInterval);
    COMMAND_FOOTER();
}

/*
 * Attribute TargetPositionLiftPercent100ths
 */
PacketBufferHandle encodeWindowCoveringClusterReadTargetPositionLiftPercent100thsAttribute(uint8_t seqNum,
                                                                                           EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringTargetPositionLiftPercent100ths", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::TargetPositionLiftPercent100ths);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeWindowCoveringClusterConfigureTargetPositionLiftPercent100thsAttribute(
    uint8_t seqNum, EndpointId destinationEndpoint, uint16_t minInterval, uint16_t maxInterval, uint16_t change)
{
    COMMAND_HEADER("ReportWindowCoveringTargetPositionLiftPercent100ths", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(WindowCovering::Attributes::Ids::TargetPositionLiftPercent100ths)
        .Put8(33)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute TargetPositionTiltPercent100ths
 */
PacketBufferHandle encodeWindowCoveringClusterReadTargetPositionTiltPercent100thsAttribute(uint8_t seqNum,
                                                                                           EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringTargetPositionTiltPercent100ths", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::TargetPositionTiltPercent100ths);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeWindowCoveringClusterConfigureTargetPositionTiltPercent100thsAttribute(
    uint8_t seqNum, EndpointId destinationEndpoint, uint16_t minInterval, uint16_t maxInterval, uint16_t change)
{
    COMMAND_HEADER("ReportWindowCoveringTargetPositionTiltPercent100ths", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(WindowCovering::Attributes::Ids::TargetPositionTiltPercent100ths)
        .Put8(33)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute EndProductType
 */
PacketBufferHandle encodeWindowCoveringClusterReadEndProductTypeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringEndProductType", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::EndProductType);
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentPositionLiftPercent100ths
 */
PacketBufferHandle encodeWindowCoveringClusterReadCurrentPositionLiftPercent100thsAttribute(uint8_t seqNum,
                                                                                            EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringCurrentPositionLiftPercent100ths", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionLiftPercent100ths);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeWindowCoveringClusterConfigureCurrentPositionLiftPercent100thsAttribute(
    uint8_t seqNum, EndpointId destinationEndpoint, uint16_t minInterval, uint16_t maxInterval, uint16_t change)
{
    COMMAND_HEADER("ReportWindowCoveringCurrentPositionLiftPercent100ths", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionLiftPercent100ths)
        .Put8(33)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute CurrentPositionTiltPercent100ths
 */
PacketBufferHandle encodeWindowCoveringClusterReadCurrentPositionTiltPercent100thsAttribute(uint8_t seqNum,
                                                                                            EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringCurrentPositionTiltPercent100ths", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionTiltPercent100ths);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeWindowCoveringClusterConfigureCurrentPositionTiltPercent100thsAttribute(
    uint8_t seqNum, EndpointId destinationEndpoint, uint16_t minInterval, uint16_t maxInterval, uint16_t change)
{
    COMMAND_HEADER("ReportWindowCoveringCurrentPositionTiltPercent100ths", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(WindowCovering::Attributes::Ids::CurrentPositionTiltPercent100ths)
        .Put8(33)
        .Put16(minInterval)
        .Put16(maxInterval);
    buf.Put16(static_cast<uint16_t>(change));
    COMMAND_FOOTER();
}

/*
 * Attribute InstalledOpenLimitLift
 */
PacketBufferHandle encodeWindowCoveringClusterReadInstalledOpenLimitLiftAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringInstalledOpenLimitLift", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::InstalledOpenLimitLift);
    COMMAND_FOOTER();
}

/*
 * Attribute InstalledClosedLimitLift
 */
PacketBufferHandle encodeWindowCoveringClusterReadInstalledClosedLimitLiftAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringInstalledClosedLimitLift", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::InstalledClosedLimitLift);
    COMMAND_FOOTER();
}

/*
 * Attribute InstalledOpenLimitTilt
 */
PacketBufferHandle encodeWindowCoveringClusterReadInstalledOpenLimitTiltAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringInstalledOpenLimitTilt", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::InstalledOpenLimitTilt);
    COMMAND_FOOTER();
}

/*
 * Attribute InstalledClosedLimitTilt
 */
PacketBufferHandle encodeWindowCoveringClusterReadInstalledClosedLimitTiltAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringInstalledClosedLimitTilt", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::InstalledClosedLimitTilt);
    COMMAND_FOOTER();
}

/*
 * Attribute Mode
 */
PacketBufferHandle encodeWindowCoveringClusterReadModeAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringMode", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::Mode);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeWindowCoveringClusterWriteModeAttribute(uint8_t seqNum, EndpointId destinationEndpoint, uint8_t mode)
{
    COMMAND_HEADER("WriteWindowCoveringMode", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::WriteAttributes)
        .Put32(WindowCovering::Attributes::Ids::Mode)
        .Put8(24)
        .Put8(static_cast<uint8_t>(mode));
    COMMAND_FOOTER();
}

/*
 * Attribute SafetyStatus
 */
PacketBufferHandle encodeWindowCoveringClusterReadSafetyStatusAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringSafetyStatus", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(WindowCovering::Attributes::Ids::SafetyStatus);
    COMMAND_FOOTER();
}

PacketBufferHandle encodeWindowCoveringClusterConfigureSafetyStatusAttribute(uint8_t seqNum, EndpointId destinationEndpoint,
                                                                             uint16_t minInterval, uint16_t maxInterval)
{
    COMMAND_HEADER("ReportWindowCoveringSafetyStatus", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ConfigureReporting)
        .Put8(EMBER_ZCL_REPORTING_DIRECTION_REPORTED)
        .Put32(WindowCovering::Attributes::Ids::SafetyStatus)
        .Put8(25)
        .Put16(minInterval)
        .Put16(maxInterval);
    COMMAND_FOOTER();
}

/*
 * Attribute ClusterRevision
 */
PacketBufferHandle encodeWindowCoveringClusterReadClusterRevisionAttribute(uint8_t seqNum, EndpointId destinationEndpoint)
{
    COMMAND_HEADER("ReadWindowCoveringClusterRevision", WindowCovering::Id);
    buf.Put8(kFrameControlGlobalCommand)
        .Put8(seqNum)
        .Put32(Globals::Commands::Ids::ReadAttributes)
        .Put32(Globals::Attributes::Ids::ClusterRevision);
    COMMAND_FOOTER();
}
